messaging4: Fix a memleak in an error path
authorVolker Lendecke <vl@samba.org>
Thu, 17 Jul 2014 14:54:32 +0000 (14:54 +0000)
committerVolker Lendecke <vl@samba.org>
Mon, 21 Jul 2014 16:00:10 +0000 (18:00 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/lib/messaging/messaging.c

index 7c05e5291d29d4f67d42e508df3d8e33686178c6..00cff1210df0f51294c6de81cd985de5ba0a380f 100644 (file)
@@ -967,6 +967,7 @@ struct server_id *irpc_servers_byname(struct imessaging_context *msg_ctx,
        count = rec.dsize / sizeof(struct server_id);
        ret = talloc_array(mem_ctx, struct server_id, count+1);
        if (ret == NULL) {
+               free(rec.dptr);
                return NULL;
        }
        for (i=0;i<count;i++) {