From: Lennart Poettering Date: Sat, 10 Sep 2005 02:20:00 +0000 (+0000) Subject: fix bad memory access X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=02e302dc116e359471aee1d9fb4f99fc0d442f24;p=catta fix bad memory access git-svn-id: file:///home/lennart/svn/public/avahi/trunk@560 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-common/strlst.c b/avahi-common/strlst.c index a7df6c9..04941b4 100644 --- a/avahi-common/strlst.c +++ b/avahi-common/strlst.c @@ -477,10 +477,13 @@ uint32_t avahi_string_list_get_service_cookie(AvahiStringList *l) { return AVAHI_SERVICE_COOKIE_INVALID; ret = (uint32_t) strtoll(value, &end, 0); - avahi_free(value); - if (*value && end && *end != 0) + if (*value && end && *end != 0) { + avahi_free(value); return AVAHI_SERVICE_COOKIE_INVALID; + } + avahi_free(value); + return ret; }