summaryrefslogtreecommitdiffstats
path: root/source4/lib/messaging/messaging.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-07-22 10:34:08 +0000
committerVolker Lendecke <vl@samba.org>2014-07-22 15:31:38 +0200
commita017280ca554a534d9422a055b1cfc0baa3eb8c6 (patch)
treebd63962946ce5c9bd455571f0763a4dc4d34a788 /source4/lib/messaging/messaging.c
parent478ef9493f131c4d94bada708f790db3254f0a59 (diff)
downloadsamba-a017280ca554a534d9422a055b1cfc0baa3eb8c6.tar.gz
samba-a017280ca554a534d9422a055b1cfc0baa3eb8c6.tar.xz
samba-a017280ca554a534d9422a055b1cfc0baa3eb8c6.zip
messaging4: Fix a just-introduced error memleak
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jul 22 15:31:38 CEST 2014 on sn-devel-104
Diffstat (limited to 'source4/lib/messaging/messaging.c')
-rw-r--r--source4/lib/messaging/messaging.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index 137d859f2b..4242b1cc85 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -969,6 +969,11 @@ NTSTATUS irpc_servers_byname(struct imessaging_context *msg_ctx,
count = rec.dsize / sizeof(struct server_id);
if (count == 0) {
+ /*
+ * In a corrupted db we could end up with a record of size
+ * less than a struct server_id. Don't leak in this case.
+ */
+ free(rec.dptr);
return NT_STATUS_NOT_FOUND;
}