aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nng.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nng.c b/src/nng.c
index 54df9980..ac84012a 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -182,7 +182,8 @@ nng_send(nng_socket sid, void *buf, size_t len, int flags)
memcpy(nng_msg_body(msg), buf, len);
if ((rv = nng_sendmsg(sid, msg, flags)) != 0) {
nng_msg_free(msg);
- } else if (flags & NNG_FLAG_ALLOC) {
+ }
+ if (flags & NNG_FLAG_ALLOC) {
nni_free(buf, len);
}
return (rv);