From: Jaroslav Kysela Date: Sat, 13 Sep 2014 16:10:03 +0000 (+0200) Subject: avahi: make sure that mallocated path is freed X-Git-Tag: v4.1~1380 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6f02420496b23d390859d7e677740e80cb80609;p=thirdparty%2Ftvheadend.git avahi: make sure that mallocated path is freed --- diff --git a/src/avahi.c b/src/avahi.c index 5a1bb6872..2260ec3ba 100644 --- a/src/avahi.c +++ b/src/avahi.c @@ -112,7 +112,7 @@ static void create_services(AvahiClient *c) { char *n; - char *path; + char *path = NULL; int ret; assert(c); @@ -162,8 +162,6 @@ create_services(AvahiClient *c) path, NULL)) < 0) { - free(path); - if (ret == AVAHI_ERR_COLLISION) goto collision; @@ -182,6 +180,7 @@ create_services(AvahiClient *c) } } + free(path); return; collision: @@ -201,7 +200,7 @@ create_services(AvahiClient *c) return; fail: - return; + free(path); }