summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-01-23 22:28:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:17 -0500
commit14503a65ec81ae15a05633b0aea6e62e35b021f3 (patch)
tree7b7f79384a7a43fa9c558cca771180ed4b9ea41b
parenta80732cf0010404ef52f9ba05fd6e318461ae375 (diff)
downloadsamba-14503a65ec81ae15a05633b0aea6e62e35b021f3.tar.gz
samba-14503a65ec81ae15a05633b0aea6e62e35b021f3.tar.bz2
samba-14503a65ec81ae15a05633b0aea6e62e35b021f3.zip
r20984: Try to ensure we can't have sig_state dissapear before se.
I think this happens when both are eventual children of the autofree context. (Trying to track down a valgrind error on fort). Andrew Bartlett (This used to be commit aee751497ca738fa0de72dd0748590a74d5af2fd)
-rw-r--r--source4/lib/events/events_signal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/events/events_signal.c b/source4/lib/events/events_signal.c
index 2c18a677b1..9a8ebea6ae 100644
--- a/source4/lib/events/events_signal.c
+++ b/source4/lib/events/events_signal.c
@@ -171,6 +171,11 @@ struct signal_event *common_event_add_signal(struct event_context *ev,
se->private_data = private_data;
se->signum = signum;
se->sa_flags = sa_flags;
+
+ /* Ensure, no matter the destruction order, that we always have a handle on the global sig_state */
+ if (!talloc_reference(se, sig_state)) {
+ return NULL;
+ }
/* only install a signal handler if not already installed */
if (sig_state->sig_handlers[signum] == NULL) {