From 0d02f4b52ac2633125f7b80f9ef0cad30aa21b65 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 8 May 2012 00:03:00 -0400 Subject: [PATCH] rculfhash tests: add missing check We need to check if test_ht is NULL. Signed-off-by: Mathieu Desnoyers --- tests/test_urcu_hash.c | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.34.1