From ac8415c24ffea645105c3859e814843e81c97f8a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 16 Jan 2017 16:27:22 -0800 Subject: Start of event framework. This compiles correctly, but doesn't actually deliver events yet. As part of this, I've made most of the initializables in nng safe to tear-down if uninitialized (or set to zero e.g. via calloc). This makes it loads easier to write the teardown on error code, since I can deinit everything, without worrying about which things have been initialized and which have not. --- src/protocol/pair/pair.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/protocol/pair') diff --git a/src/protocol/pair/pair.c b/src/protocol/pair/pair.c index 0d8b32fe..d6c2eedf 100644 --- a/src/protocol/pair/pair.c +++ b/src/protocol/pair/pair.c @@ -64,7 +64,9 @@ nni_pair_sock_fini(void *arg) { nni_pair_sock *psock = arg; - NNI_FREE_STRUCT(psock); + if (psock != NULL) { + NNI_FREE_STRUCT(psock); + } } @@ -89,7 +91,9 @@ nni_pair_pipe_fini(void *arg) { nni_pair_pipe *ppipe = arg; - NNI_FREE_STRUCT(ppipe); + if (ppipe != NULL) { + NNI_FREE_STRUCT(ppipe); + } } -- cgit v1.2.3-70-g09d2