andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 2a2a33eb0bb08d81924f0e0a81168486b78f43ce Mon Sep 17 00:00:00 2001
dc8c34
From: Mark Reynolds <mreynolds@redhat.com>
dc8c34
Date: Thu, 18 Jul 2013 15:50:36 -0400
dc8c34
Subject: [PATCH 85/99] Ticket 47421 - memory leaks in set_krb5_creds
dc8c34
dc8c34
Bug Description:  Valgrind shows memory leaks in set_krb5_creds()
dc8c34
dc8c34
Fix description:  krb5_unparse_name() allocates/returns the principle name.
dc8c34
                  But we can call this function twice without freeing the first
dc8c34
                  returned value.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/47421
dc8c34
dc8c34
Reviewed by: richm(Thanks!)
dc8c34
(cherry picked from commit db124a2711576de2dd0009528d60b2860e815210)
dc8c34
(cherry picked from commit c1dcfc605b56a61199d827f213c490e109d8279e)
dc8c34
---
dc8c34
 ldap/servers/slapd/ldaputil.c | 1 +
dc8c34
 1 file changed, 1 insertion(+)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c
dc8c34
index 3041f51..331dd71 100644
dc8c34
--- a/ldap/servers/slapd/ldaputil.c
dc8c34
+++ b/ldap/servers/slapd/ldaputil.c
dc8c34
@@ -1901,6 +1901,7 @@ set_krb5_creds(
dc8c34
         }
dc8c34
     }
dc8c34
 
dc8c34
+    slapi_ch_free_string(&princ_name);
dc8c34
     if ((rc = krb5_unparse_name(ctx, princ, &princ_name))) {
dc8c34
         slapi_log_error(SLAPI_LOG_FATAL, logname,
dc8c34
                         "Unable to get name of principal: "
dc8c34
-- 
dc8c34
1.8.1.4
dc8c34