rculfhash tests: add missing check
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 8 May 2012 04:03:00 +0000 (00:03 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 8 May 2012 04:03:00 +0000 (00:03 -0400)
We need to check if test_ht is NULL.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/test_urcu_hash.c

index accf3c1ab1ff76a0e37b876da268ba690122e916..2223413c8067506ba1441ea91b3298da0340c2e2 100644 (file)
@@ -560,6 +560,10 @@ int main(int argc, char **argv)
                                (opt_auto_resize ? CDS_LFHT_AUTO_RESIZE : 0) |
                                CDS_LFHT_ACCOUNTING, NULL);
        }
+       if (!test_ht) {
+               printf("Error allocating hash table.\n");
+               return -1;
+       }
 
        /*
         * Hash Population needs to be seen as a RCU reader
This page took 0.02546 seconds and 4 git commands to generate.