svn commit: r221953 - head/sys/geom/eli
Mikolaj Golub
trociny at FreeBSD.org
Sun May 15 12:39:31 UTC 2011
Author: trociny
Date: Sun May 15 12:39:30 2011
New Revision: 221953
URL: http://svn.freebsd.org/changeset/base/221953
Log:
Fix a memory leak possible in g_eli_key_allocate() if the key with the
same keyno is added while we aren't holding the lock.
Approved by: pjd (mentor)
MFC after: 1 week
Modified:
head/sys/geom/eli/g_eli_key_cache.c
Modified: head/sys/geom/eli/g_eli_key_cache.c
==============================================================================
--- head/sys/geom/eli/g_eli_key_cache.c Sun May 15 11:45:13 2011 (r221952)
+++ head/sys/geom/eli/g_eli_key_cache.c Sun May 15 12:39:30 2011 (r221953)
@@ -124,6 +124,7 @@ g_eli_key_allocate(struct g_eli_softc *s
ekey = RB_FIND(g_eli_key_tree, &sc->sc_ekeys_tree, &keysearch);
if (ekey != NULL) {
bzero(key, sizeof(*key));
+ free(key, M_ELI);
key = ekey;
TAILQ_REMOVE(&sc->sc_ekeys_queue, key, gek_next);
} else {
More information about the svn-src-all
mailing list