]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix recent memory leak in locate_kdc.c 473/head
authorGreg Hudson <ghudson@mit.edu>
Tue, 21 Jun 2016 22:46:28 +0000 (18:46 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 29 Jun 2016 17:06:35 +0000 (13:06 -0400)
Commit ce112dec844e4650b5ad174bd40f21c32aebe1d1 introduced a memory
leak in locate_srv_conf_1() by moving the free(realmstr) call to the
cleanup handler, because there was an early return after realmstr is
allocated.  Convert that early return to a goto.

src/lib/krb5/os/locate_kdc.c

index cd48627f77505c5447b1801b157f30b3803d180e..6d4416c9964e884467fad4504cd5841c65a51d48 100644 (file)
@@ -240,7 +240,7 @@ locate_srv_conf_1(krb5_context context, const krb5_data *realm,
                  error_message(code));
         if (code == PROF_NO_SECTION || code == PROF_NO_RELATION)
             code = 0;
-        return code;
+        goto cleanup;
     }
 
     for (i=0; hostlist[i]; i++) {