summaryrefslogtreecommitdiffstats
path: root/source4/lib/messaging/messaging.c
diff options
context:
space:
mode:
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;
}