From: Greg Hudson Date: Sun, 5 Aug 2018 23:00:33 +0000 (-0400) Subject: Fix memory leaks in test programs X-Git-Tag: krb5-1.17-beta1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91cd841086cdfbb7f171126ca132301123daf15e;p=thirdparty%2Fkrb5.git Fix memory leaks in test programs Fix additional memory leaks detected by a newer asan (clang version 6.0.0) in test programs. --- diff --git a/src/lib/krb5/krb/t_valid_times.c b/src/lib/krb5/krb/t_valid_times.c index 1b469ffc25..e4b5f1bce4 100644 --- a/src/lib/krb5/krb/t_valid_times.c +++ b/src/lib/krb5/krb/t_valid_times.c @@ -105,5 +105,7 @@ main() ret = krb5int_validate_times(context, ×); assert(ret == KRB5KRB_AP_ERR_TKT_EXPIRED); + krb5_free_context(context); + return 0; } diff --git a/src/util/profile/prof_test1 b/src/util/profile/prof_test1 index 7d13c93892..fc675714d0 100644 --- a/src/util/profile/prof_test1 +++ b/src/util/profile/prof_test1 @@ -360,6 +360,7 @@ proc test10 {} { puts stderr "Error: test10: Did not find expected chores." exit 1 } + profile_release $p } test1 diff --git a/src/util/profile/profile_tcl.c b/src/util/profile/profile_tcl.c index eb9950a100..de61baecf6 100644 --- a/src/util/profile/profile_tcl.c +++ b/src/util/profile/profile_tcl.c @@ -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);