aboutsummaryrefslogtreecommitdiff
path: root/src/core/objhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/objhash.c')
-rw-r--r--src/core/objhash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/objhash.c b/src/core/objhash.c
index 9529ac30..a25b35d9 100644
--- a/src/core/objhash.c
+++ b/src/core/objhash.c
@@ -82,6 +82,9 @@ nni_objhash_init(nni_objhash **ohp, nni_objhash_ctor ctor,
void
nni_objhash_fini(nni_objhash *oh)
{
+ if (oh == NULL) {
+ return;
+ }
if (oh->oh_nodes != NULL) {
nni_free(oh->oh_nodes, oh->oh_cap * sizeof (nni_objhash_node));
oh->oh_nodes = NULL;