]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix memory leaks in test programs 824/head
authorGreg Hudson <ghudson@mit.edu>
Sun, 5 Aug 2018 23:00:33 +0000 (19:00 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 9 Aug 2018 16:15:53 +0000 (12:15 -0400)
Fix additional memory leaks detected by a newer asan (clang version
6.0.0) in test programs.

src/lib/krb5/krb/t_valid_times.c
src/util/profile/prof_test1
src/util/profile/profile_tcl.c

index 1b469ffc252f108253809d88bd6b5a12a037080a..e4b5f1bce477ab3fb461bef7b43b3ac07356b023 100644 (file)
@@ -105,5 +105,7 @@ main()
     ret = krb5int_validate_times(context, &times);
     assert(ret == KRB5KRB_AP_ERR_TKT_EXPIRED);
 
+    krb5_free_context(context);
+
     return 0;
 }
index 7d13c938921ad43eba25f521b811946ad8c7d0ab..fc675714d0af0b8761c98a18c900bd7c12da70f0 100644 (file)
@@ -360,6 +360,7 @@ proc test10 {} {
        puts stderr "Error: test10: Did not find expected chores."
        exit 1
     }
+    profile_release $p
 }
 
 test1
index eb9950a100a6db15506a4b08fa40aec97cc668b9..de61baecf69ec7207ac9eddefb2258cebf00f11a 100644 (file)
@@ -2234,6 +2234,7 @@ _wrap_profile_get_string(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, i
     char *s = (arg6 && *arg6) ? *arg6 : "";
     Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
       Tcl_NewStringObj(s, strlen(s)));
+    profile_release_string(s);
   }
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);