talloc: Fix the O3 developer build
authorVolker Lendecke <vl@samba.org>
Mon, 12 Oct 2015 10:06:50 +0000 (12:06 +0200)
committerRalph Böhme <slow@samba.org>
Mon, 12 Oct 2015 12:02:11 +0000 (14:02 +0200)
Compilers can't see that the child exits. Thus "exit_status" is
used uninitialized in the child.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/talloc/testsuite.c

index 9f830390d364cf0ba6bbf69c89f54a8140902b3d..34410b81c3f3a12b262e9dd02a8174a0a89d5715 100644 (file)
@@ -1895,10 +1895,13 @@ static bool test_magic_protection(void)
 
                /* Then the attack takes effect when the memory's freed. */
                talloc_free(pool);
-       } else {
-               while (wait(&exit_status) != pid);
+
+               /* Never reached. Make compilers happy */
+               return true;
        }
 
+       while (wait(&exit_status) != pid);
+
        if (!WIFEXITED(exit_status)) {
                printf("Child exited through unexpected abnormal means\n");
                return false;