From 993373140212da702e1a845188cbe4dc44a76ad5 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 6 Jun 2017 07:48:28 -0700 Subject: Make objhash fini calls idempotent. --- src/core/objhash.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/objhash.c') 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; -- cgit v1.2.3-70-g09d2