From: Mathieu Desnoyers Date: Tue, 8 May 2012 04:03:00 +0000 (-0400) Subject: rculfhash tests: add missing check X-Git-Tag: v0.7.0~16 X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=0d02f4b52ac2633125f7b80f9ef0cad30aa21b65 rculfhash tests: add missing check We need to check if test_ht is NULL. Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/test_urcu_hash.c b/tests/test_urcu_hash.c index accf3c1..2223413 100644 --- a/tests/test_urcu_hash.c +++ b/tests/test_urcu_hash.c @@ -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