diff --git a/lib/format_ndag.c b/lib/format_ndag.c index 8c66de76..a26977e5 100644 --- a/lib/format_ndag.c +++ b/lib/format_ndag.c @@ -319,6 +319,9 @@ static int join_multicast_group(char *groupaddr, char *localiface, } sockcreateover: + if (!srcinfo) { + freeaddrinfo(gotten); + } freeaddrinfo(group); return sock; } @@ -789,6 +792,10 @@ static void free_streamsock_data(streamsock_t *src) free(src->singlemsg.msg_iov); } + if (src->srcaddr) { + freeaddrinfo(src->srcaddr); + } + if (src->sock != -1) { close(src->sock); }