Skip to content

Commit

Permalink
Fix memory leak in SPNEGO initiator
Browse files Browse the repository at this point in the history
If we eliminate a mechanism from the initiator list because
gss_init_sec_context fails, free the memory for that mech OID before
removing it from the list.

[ghudson@mit.edu: clarified commit message]

ticket: 7803 (new)
target_version: 1.12.1
tags: pullup
  • Loading branch information
simo5 authored and greghudson committed Dec 16, 2013
1 parent 1249c75 commit 1cda48a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/gssapi/spnego/spnego_mech.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ init_ctx_call_init(OM_uint32 *minor_status,
* can do this with recursion. If all mechanisms produce errors, the
* caller should get the error from the first mech in the list.
*/
gssalloc_free(sc->mech_set->elements->elements);
memmove(sc->mech_set->elements, sc->mech_set->elements + 1,
--sc->mech_set->count * sizeof(*sc->mech_set->elements));
if (sc->mech_set->count == 0)
Expand Down

0 comments on commit 1cda48a

Please sign in to comment.