From 763b8deee1fd38566b85d4745a83adae245d9b26 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 21 Jun 2017 14:04:16 -0700 Subject: Make APIs for holding references more consistent. --- src/core/objhash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/objhash.c') diff --git a/src/core/objhash.c b/src/core/objhash.c index 94c42dcf..5ee5f5c7 100644 --- a/src/core/objhash.c +++ b/src/core/objhash.c @@ -145,7 +145,9 @@ nni_objhash_find(nni_objhash *oh, uint32_t id, void **valp) node = nni_objhash_find_node(oh, id); if ((node != NULL) && (node->on_val != NULL)) { - *valp = node->on_val; + if (valp != NULL) { + *valp = node->on_val; + } node->on_refcnt++; rv = 0; } else { -- cgit v1.2.3-70-g09d2