diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-06-21 14:04:16 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-06-21 14:04:16 -0700 |
| commit | 763b8deee1fd38566b85d4745a83adae245d9b26 (patch) | |
| tree | 00404dbc8e6c07fc5a9d8e07f353beff3adefd5a /src/core/objhash.c | |
| parent | f81c7e8cc84bd43bfc3cc5e41f773a0078870312 (diff) | |
| download | nng-763b8deee1fd38566b85d4745a83adae245d9b26.tar.gz nng-763b8deee1fd38566b85d4745a83adae245d9b26.tar.bz2 nng-763b8deee1fd38566b85d4745a83adae245d9b26.zip | |
Make APIs for holding references more consistent.
Diffstat (limited to 'src/core/objhash.c')
| -rw-r--r-- | src/core/objhash.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 { |
