Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
avahi: make sure that mallocated path is freed
  • Loading branch information
perexg committed Sep 13, 2014
1 parent 1ac14a2 commit c6f0242
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/avahi.c
Expand Up @@ -112,7 +112,7 @@ static void
create_services(AvahiClient *c)
{
char *n;
char *path;
char *path = NULL;
int ret;
assert(c);

Expand Down Expand Up @@ -162,8 +162,6 @@ create_services(AvahiClient *c)
path,
NULL)) < 0) {

free(path);

if (ret == AVAHI_ERR_COLLISION)
goto collision;

Expand All @@ -182,6 +180,7 @@ create_services(AvahiClient *c)
}
}

free(path);
return;

collision:
Expand All @@ -201,7 +200,7 @@ create_services(AvahiClient *c)
return;

fail:
return;
free(path);
}


Expand Down

0 comments on commit c6f0242

Please sign in to comment.