Plug a memory leak in gss_indicate_mechs
authorGreg Hudson <ghudson@mit.edu>
Sat, 9 Oct 2010 11:46:53 +0000 (11:46 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sat, 9 Oct 2010 11:46:53 +0000 (11:46 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24447 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/mechglue/g_initialize.c

index 8f99a46c742447220c3210566b36f55d8d4bd6ed..caeec92230dc9e8a07760b21a3d67f8364bba554 100644 (file)
@@ -249,8 +249,10 @@ gss_OID_set *mechSet_out;
         * I'm copying it.
         */
        *minorStatus = k5_mutex_lock(&g_mechSetLock);
-       if (*minorStatus)
+       if (*minorStatus) {
+               free(mechSet);
                return GSS_S_FAILURE;
+       }
 
        /* allocate space for the oid structures */
        if ((mechSet->elements =