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:
parent
8142e108c7
commit
979693069a
@ -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);
|
||||
|
@ -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)));
|
||||
|
Loading…
Reference in New Issue
Block a user