ldb: Free memory when repacking database master
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 30 Jul 2019 22:54:29 +0000 (10:54 +1200)
committerGarming Sam <garming@samba.org>
Tue, 20 Aug 2019 03:39:55 +0000 (03:39 +0000)
The msg for each database record is allocated on the module context, but
never freed. The module seems like it could be a long-running context (as
the database would normally get repacked by the samba executable).

Even if it's not a proper leak, it shouldn't hurt to cleanup the memory.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/ldb_key_value/ldb_kv_index.c

index d955517ea103ab7b2f1b10be25618b88b6ea3252..0853b28fe400fe5ac97146840ad07d048950e3e9 100644 (file)
@@ -3599,6 +3599,7 @@ static int re_pack(struct ldb_kv_private *ldb_kv,
                          ctx->count);
        }
 
+       talloc_free(msg);
        return 0;
 }