Skip to content

Commit

Permalink
coverity: fix dns_sd_avahi (Resource leak)
Browse files Browse the repository at this point in the history
CID 355435 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable d going out of scope leaks the storage it points to.

was freeing wrong var on error return path

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz committed Apr 3, 2020
1 parent 9ba5de1 commit 3a667fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dns_sd_avahi.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static int new_discovery_data(struct dns_sd_discovery_data **data)

d->address = zalloc(sizeof(struct AvahiAddress));
if (!d->address) {
free(data);
free(d);
return -ENOMEM;
}

Expand Down

0 comments on commit 3a667fa

Please sign in to comment.