Skip to content

Commit

Permalink
mdns: Fix incorrect free
Browse files Browse the repository at this point in the history
We were trying to release the pointer that we failed to allocate.
Instead, free the pointer that actually was allocated before
  • Loading branch information
chouquette committed Mar 19, 2020
1 parent eab6fbb commit 1a98ec9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ mdns_list_interfaces(multicast_if** pp_intfs, struct mdns_ip **pp_mdns_ips, size
memset(intfs, 0, sizeof(*intfs));
*pp_mdns_ips = mdns_ips = malloc(sizeof(*mdns_ips));
if (mdns_ips == NULL) {
free(mdns_ips);
free(intfs);
return (MDNS_ERROR);
}
memset(mdns_ips, 0, sizeof(*mdns_ips));
Expand Down

0 comments on commit 1a98ec9

Please sign in to comment.