[30268] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Fix memory leaks in test programs

daemon@ATHENA.MIT.EDU (Greg Hudson)
Thu Aug 9 12:46:47 2018

Date: Thu, 9 Aug 2018 12:41:24 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201808091641.w79GfOI2015667@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/91cd841086cdfbb7f171126ca132301123daf15e
commit 91cd841086cdfbb7f171126ca132301123daf15e
Author: Greg Hudson <ghudson@mit.edu>
Date:   Sun Aug 5 19:00:33 2018 -0400

    Fix memory leaks in test programs
    
    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 |    2 ++
 src/util/profile/prof_test1      |    1 +
 src/util/profile/profile_tcl.c   |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/lib/krb5/krb/t_valid_times.c b/src/lib/krb5/krb/t_valid_times.c
index 1b469ff..e4b5f1b 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, &times);
     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 7d13c93..fc67571 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 eb9950a..de61bae 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);
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post