Skip to content

Commit

Permalink
dns-sd: Fix leak in dnssd_find_hosts()
Browse files Browse the repository at this point in the history
We need to destroy the iio_mutex in case we fail to allocate a new avahi
poll.

Signed-off-by: Nuno Sá <[email protected]>
  • Loading branch information
nunojsa authored and pcercuei committed Apr 16, 2021
1 parent c188d75 commit 8e7f5d7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dns_sd_avahi.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ int dnssd_find_hosts(struct dns_sd_discovery_data **ddata)

d->poll = avahi_simple_poll_new();
if (!d->poll) {
iio_mutex_destroy(d->lock);
dnssd_free_all_discovery_data(d);
return -ENOMEM;
}
Expand Down

0 comments on commit 8e7f5d7

Please sign in to comment.