1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ctdb-daemon: Avoid memory leak

ctdb->idr and ctdb->srv get initialized as part of ctdb_init() called
from ctdb_cmdline_init().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-04-05 17:11:17 +10:00 committed by Martin Schwenke
parent 8142e108c7
commit 979693069a
2 changed files with 2 additions and 0 deletions

View File

@ -1276,6 +1276,7 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork)
ctdb_set_child_logging(ctdb);
TALLOC_FREE(ctdb->srv);
if (srvid_init(ctdb, &ctdb->srv) != 0) {
DEBUG(DEBUG_CRIT,("Failed to setup message srvid context\n"));
exit(1);

View File

@ -197,6 +197,7 @@ int main(int argc, const char *argv[])
ctdb->upcalls = &ctdb_upcalls;
ctdb->recovery_lock_fd = -1;
TALLOC_FREE(ctdb->idr);
ret = reqid_init(ctdb, 0, &ctdb->idr);;
if (ret != 0) {
DEBUG(DEBUG_ALERT, ("reqid_init failed (%s)\n", strerror(ret)));