]> git.ipfire.org Git - thirdparty/krb5.git/commit
Fix a small memory leak in util_errmap
authorGreg Hudson <ghudson@mit.edu>
Mon, 31 Dec 2012 22:21:46 +0000 (17:21 -0500)
committerGreg Hudson <ghudson@mit.edu>
Tue, 1 Jan 2013 22:41:49 +0000 (17:41 -0500)
commit379d39c17b8930718e98185a5b32a0f7f3e3b4b6
tree8de619a7795a29019f3941a4117ad58684c40d71
parent54fa4433df7412267375240aba40959e97ac4fe2
Fix a small memory leak in util_errmap

Calls to gssint_mecherrmap_map_errcode would result in calling
mecherror_copy with a zero-length mech OID, which would result in an
OID with 0 for length and malloc(0) for elements.  On platforms which
return non-null from malloc(0), gssint_mecherrmap_destroy() wouldn't
free the elements pointer.

Avoid calling malloc(0) and don't use the length field to decide
whether to free an elements pointer.
src/lib/gssapi/generic/util_errmap.c