Browse Source

Ticket 47421 - memory leaks in set_krb5_creds

Bug Description:  Valgrind shows memory leaks in set_krb5_creds()

Fix description:  krb5_unparse_name() allocates/returns the principle name.
                  But we can call this function twice without freeing the first
                  returned value.

https://fedorahosted.org/389/ticket/47421

Reviewed by: richm(Thanks!)
Mark Reynolds 12 years ago
parent
commit
db124a2711
1 changed files with 1 additions and 0 deletions
  1. 1 0
      ldap/servers/slapd/ldaputil.c

+ 1 - 0
ldap/servers/slapd/ldaputil.c

@@ -1950,6 +1950,7 @@ set_krb5_creds(
         }
     }
 
+    slapi_ch_free_string(&princ_name);
     if ((rc = krb5_unparse_name(ctx, princ, &princ_name))) {
         slapi_log_error(SLAPI_LOG_FATAL, logname,
                         "Unable to get name of principal: "