diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-07 18:16:06 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-07 18:16:06 -0700 |
| commit | 705d39a6daf99b44c820631f04a116cc09b134b5 (patch) | |
| tree | 27c4ce47169afdf808768809f6630584ee25e55a | |
| parent | 89b0ed1d48b7eca821c556833f0b2da39739ee09 (diff) | |
| download | nng-705d39a6daf99b44c820631f04a116cc09b134b5.tar.gz nng-705d39a6daf99b44c820631f04a116cc09b134b5.tar.bz2 nng-705d39a6daf99b44c820631f04a116cc09b134b5.zip | |
Address possible leak on send failure.
| -rw-r--r-- | src/nng.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |
