summaryrefslogtreecommitdiff
path: root/source4/ldap_server
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-09-13 22:05:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:09 -0500
commita129ad36eb34bbeda80c75b2f8d771bdaca8451e (patch)
tree07a70c2d8d5a7f687a79334874b4a3d34701922b /source4/ldap_server
parent234481fd40f02a3cd2cccfea0909d248b82a83d8 (diff)
downloadsamba-a129ad36eb34bbeda80c75b2f8d771bdaca8451e.tar.gz
samba-a129ad36eb34bbeda80c75b2f8d771bdaca8451e.tar.bz2
samba-a129ad36eb34bbeda80c75b2f8d771bdaca8451e.zip
r10213: fixed a memory leak in the ldap client and server code spotted by Karl
Melcher. ldap_encode() now takes a memory context to use for the data blob (This used to be commit 09948a59336a7f02bf2b4605f2d4d886e65b85f2)
Diffstat (limited to 'source4/ldap_server')
-rw-r--r--source4/ldap_server/ldap_server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c
index 4320a0ad5e..92adc8a890 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -87,12 +87,14 @@ static void ldapsrv_process_message(struct ldapsrv_connection *conn,
DATA_BLOB b;
msg = call->replies->msg;
- if (!ldap_encode(msg, &b)) {
+ if (!ldap_encode(msg, &b, call)) {
DEBUG(0,("Failed to encode ldap reply of type %d\n", msg->type));
goto failed;
}
status = data_blob_append(call, &blob, b.data, b.length);
+ data_blob_free(&b);
+
if (!NT_STATUS_IS_OK(status)) goto failed;
DLIST_REMOVE(call->replies, call->replies);