Skip to content

Commit

Permalink
ldb: Free memory when repacking database
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
Reviewed-by: Garming Sam <[email protected]>

Autobuild-User(master): Garming Sam <[email protected]>
Autobuild-Date(master): Tue Aug 20 04:57:10 UTC 2019 on sn-devel-184
  • Loading branch information
tlbeale authored and GSam committed Aug 20, 2019
1 parent ee6537c commit b6516db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/ldb/ldb_key_value/ldb_kv_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -3599,6 +3599,7 @@ static int re_pack(struct ldb_kv_private *ldb_kv,
ctx->count);
}

talloc_free(msg);
return 0;
}

Expand Down

0 comments on commit b6516db

Please sign in to comment.