summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-10-20 02:11:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:01:56 -0500
commitb261082333435ce37088f37e7417e1cd5688f60b (patch)
tree348df7facb68520e24364493962e2e5184a47475 /source4/rpc_server
parenta71b9135710995a381f0bfaea29fe1a9da93ce20 (diff)
downloadsamba-b261082333435ce37088f37e7417e1cd5688f60b.tar.gz
samba-b261082333435ce37088f37e7417e1cd5688f60b.tar.bz2
samba-b261082333435ce37088f37e7417e1cd5688f60b.zip
r3076: Fix memory leak.
Andrew Bartlett (This used to be commit 4091fee8e807e5cd7089dc6753324766d10678c2)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/netlogon/schannel_state.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/rpc_server/netlogon/schannel_state.c b/source4/rpc_server/netlogon/schannel_state.c
index 1153e4043d..0900c05393 100644
--- a/source4/rpc_server/netlogon/schannel_state.c
+++ b/source4/rpc_server/netlogon/schannel_state.c
@@ -68,7 +68,7 @@ NTSTATUS schannel_store_session_key(TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- asprintf(&s, "%u", (unsigned int)expiry);
+ s = talloc_asprintf(mem_ctx, "%u", (unsigned int)expiry);
if (s == NULL) {
talloc_free(ldb);
@@ -97,6 +97,8 @@ NTSTATUS schannel_store_session_key(TALLOC_CTX *mem_ctx,
ret = ldb_add(ldb->ldb, &msg);
+ talloc_free(s);
+
if (ret != 0) {
DEBUG(0,("Unable to add %s to session key db - %s\n",
msg.dn, ldb_errstring(ldb->ldb)));