mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-17 14:00:30 +08:00
Fixed memory leaks.
This commit is contained in:
parent
32d9124fed
commit
708e5abb08
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user