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
This commit is contained in:
parent
cb86ada75d
commit
76cc7f6dd6
@ -124,6 +124,7 @@ g_eli_key_allocate(struct g_eli_softc *sc, uint64_t keyno)
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user