]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
misc/tst-tsearch: Additional explicit error checking
authorFlorian Weimer <fweimer@redhat.com>
Fri, 3 May 2019 07:22:33 +0000 (09:22 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 3 May 2019 07:22:33 +0000 (09:22 +0200)
This avoids an undefined variable warning with certain GCC versions.

ChangeLog
misc/tst-tsearch.c

index 2d1907b0436ea31ac329ada38e201a76b561d703..3c4dcb31fc2c56b9cefd604de8421ea317d2b3a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-05-03  Florian Weimer  <fweimer@redhat.com>
+
+       * misc/tst-tsearch.c (walk_tree): Add more error checking.
+
 2019-05-02  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
        [BZ #24506]
index 9a570dd6c90396f592e300b3a44c728deea1f2a4..44895d4c0aa52bf61e7ec47a32dc291d57f981d9 100644 (file)
@@ -223,8 +223,10 @@ walk_tree (void *root, int expected_count)
   size_t first_list_size;
   struct walk_trace_element *first_list
     = walk_trace_finalize (&walk_trace, &first_list_size);
+  TEST_VERIFY_EXIT (first_list != NULL);
 
   walk_tree_with (root, expected_count, twalk_with_twalk_r);
+  TEST_VERIFY (!walk_trace_has_failed (&walk_trace));
 
   /* Compare the two traces.  */
   TEST_COMPARE (first_list_size, walk_trace_size (&walk_trace));