Date: Sun, 15 May 2011 12:39:31 +0000 (UTC) From: Mikolaj Golub <trociny@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r221953 - head/sys/geom/eli Message-ID: <201105151239.p4FCdVQd039581@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105151239.p4FCdVQd039581>