aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/pubsub/sub.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-03-29 23:34:29 -0700
committerGarrett D'Amore <garrett@damore.org>2017-03-29 23:34:29 -0700
commit3f4ec4032684ce1c1ee629cdf6fce992a01521b2 (patch)
tree07a753d7f80cdfe2dfca5f37d8b4734054167720 /src/protocol/pubsub/sub.c
parent86eaf052cc535658783dd5c3d5925f58fd70f983 (diff)
downloadnng-3f4ec4032684ce1c1ee629cdf6fce992a01521b2.tar.gz
nng-3f4ec4032684ce1c1ee629cdf6fce992a01521b2.tar.bz2
nng-3f4ec4032684ce1c1ee629cdf6fce992a01521b2.zip
Hopefully close shutdown race in rep.
Diffstat (limited to 'src/protocol/pubsub/sub.c')
-rw-r--r--src/protocol/pubsub/sub.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/protocol/pubsub/sub.c b/src/protocol/pubsub/sub.c
index ecfbf540..7b6e908e 100644
--- a/src/protocol/pubsub/sub.c
+++ b/src/protocol/pubsub/sub.c
@@ -71,14 +71,12 @@ nni_sub_sock_fini(void *arg)
nni_sub_sock *sub = arg;
nni_sub_topic *topic;
- if (sub != NULL) {
- while ((topic = nni_list_first(&sub->topics)) != NULL) {
- nni_list_remove(&sub->topics, topic);
- nni_free(topic->buf, topic->len);
- NNI_FREE_STRUCT(topic);
- }
- NNI_FREE_STRUCT(sub);
+ while ((topic = nni_list_first(&sub->topics)) != NULL) {
+ nni_list_remove(&sub->topics, topic);
+ nni_free(topic->buf, topic->len);
+ NNI_FREE_STRUCT(topic);
}
+ NNI_FREE_STRUCT(sub);
}