tevent_signal: Fix a valgrind error
authorVolker Lendecke <vl@samba.org>
Wed, 15 Feb 2012 15:17:34 +0000 (16:17 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 15 Feb 2012 16:58:36 +0000 (17:58 +0100)
This fixes an uninitialized read introduced by my fix for the tevent_signal
destructors. From looking at the code you might believe that this kicks in only
when talloc failed. But with -O3 I do see it in normal operations.

Sorry for that.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed Feb 15 17:58:37 CET 2012 on sn-devel-104

lib/tevent/tevent_signal.c

index 248dd35883bc29432d9a8dc730e2c0f149d4aa67..77ef7b0599a532af4cfa3786d6fd4c3403c8d68b 100644 (file)
@@ -346,6 +346,8 @@ int tevent_common_check_signal(struct tevent_context *ev)
                        struct tevent_signal *se = sl->se;
                        struct tevent_se_exists *exists;
 
+                       next = sl->next;
+
                        /*
                         * We have to be careful to not touch "se"
                         * after it was deleted in its handler. Thus
@@ -361,7 +363,6 @@ int tevent_common_check_signal(struct tevent_context *ev)
                        talloc_set_destructor(
                                exists, tevent_se_exists_destructor);
 
-                       next = sl->next;
 #ifdef SA_SIGINFO
                        if (se->sa_flags & SA_SIGINFO) {
                                uint32_t j;