git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ctdb-daemon: Don't leak memory if not using recovery lock
[obnox/samba/samba-obnox.git]
/
ctdb
/
server
/
ctdb_recover.c
diff --git
a/ctdb/server/ctdb_recover.c
b/ctdb/server/ctdb_recover.c
index 7b34d7e2913a063ea746159be52308d83ee95ec9..127ff6bdfbf0e2cee721436f00b20f84489a84c0 100644
(file)
--- a/
ctdb/server/ctdb_recover.c
+++ b/
ctdb/server/ctdb_recover.c
@@
-592,13
+592,6
@@
int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
}
}
}
}
- state = talloc(ctdb, struct ctdb_set_recmode_state);
- CTDB_NO_MEMORY(ctdb, state);
-
- state->start_time = timeval_current();
- state->fd[0] = -1;
- state->fd[1] = -1;
-
/* release any deferred attach calls from clients */
if (recmode == CTDB_RECOVERY_NORMAL) {
ctdb_process_deferred_attach(ctdb);
/* release any deferred attach calls from clients */
if (recmode == CTDB_RECOVERY_NORMAL) {
ctdb_process_deferred_attach(ctdb);
@@
-610,6
+603,13
@@
int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
return 0;
}
return 0;
}
+ state = talloc(ctdb, struct ctdb_set_recmode_state);
+ CTDB_NO_MEMORY(ctdb, state);
+
+ state->start_time = timeval_current();
+ state->fd[0] = -1;
+ state->fd[1] = -1;
+
/* For the rest of what needs to be done, we need to do this in
a child process since
1, the call to ctdb_recovery_lock() can block if the cluster
/* For the rest of what needs to be done, we need to do this in
a child process since
1, the call to ctdb_recovery_lock() can block if the cluster