Skip to content
Snippets Groups Projects
Commit 708e5abb authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fixed memory leaks.

parent 32d9124f
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment