From: Kurt Zeilenga Date: Sat, 24 Oct 1998 06:11:30 +0000 (+0000) Subject: Fixed memory leaks. X-Git-Tag: PHP3_TOOL_0_0~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=708e5abb08c4c633431e0014ad12632af1a38fef;p=openldap Fixed memory leaks. --- diff --git a/servers/slapd/back-ldbm/alias.c b/servers/slapd/back-ldbm/alias.c index 9d0dfacd71..b9c0d9481d 100644 --- a/servers/slapd/back-ldbm/alias.c +++ b/servers/slapd/back-ldbm/alias.c @@ -66,6 +66,8 @@ Entry *derefAlias_r ( Backend *be, oldDN, newDN, 0 ); send_ldap_result( conn, op, LDAP_ALIAS_PROBLEM, "", "Dangling Alias" ); + + if(matched != NULL) free(matched); } free (newDN); free (oldDN); @@ -151,6 +153,7 @@ char *derefDN ( Backend *be, if ((eNew = derefAlias_r( be, conn, op, eMatched )) == NULL) { free (matched); free (newDN); + free (remainder); break; /* no associated entry, dont deref */ } else { @@ -161,6 +164,7 @@ char *derefDN ( Backend *be, /* newDN same as old so not an alias, no need to go further */ free (newDN); free (matched); + free (remainder); break; } @@ -176,6 +180,8 @@ char *derefDN ( Backend *be, strcat (newDN, eMatched->e_dn); Debug( LDAP_DEBUG_TRACE, "<= expanded to %s\n", newDN, 0, 0 ); + free (remainder); + /* free reader lock */ cache_return_entry_r(&li->li_cache, eNew); } @@ -183,6 +189,7 @@ char *derefDN ( Backend *be, cache_return_entry_r(&li->li_cache, eMatched); } else { + if(submatch != NULL) free(submatch); break; /* there was no entry for the matched part */ } } @@ -219,5 +226,7 @@ char *derefDN ( Backend *be, Debug( LDAP_DEBUG_TRACE, "<= returning deref DN of %s\n", newDN, 0, 0 ); + free(matched); + return newDN; }