Skip to content

Commit

Permalink
mdns_resolve: Fix leak on error
Browse files Browse the repository at this point in the history
  • Loading branch information
chouquette committed Mar 19, 2020
1 parent 1a98ec9 commit 06372e6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ mdns_resolve(struct mdns_ctx *ctx, const char *addr, unsigned short port)
ctx->conns = malloc(ctx->nb_conns * sizeof(*ctx->conns));
if (ctx->conns == NULL) {
free(ifaddrs);
free(mdns_ips);
freeaddrinfo(res);
return (MDNS_ERROR);
}
Expand Down

0 comments on commit 06372e6

Please sign in to comment.