From: Benny Morgan Date: Sun, 30 Jun 2013 19:09:09 +0000 (+0200) Subject: - Fix memory leak - in case htmsg_binary_des0 return's something < 0, n and f was... X-Git-Tag: 3.4patch1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3a7e82ffd788f0caade9a3d857fcf48a4733670;p=thirdparty%2Ftvheadend.git - Fix memory leak - in case htmsg_binary_des0 return's something < 0, n and f was not free'd (cherry picked from commit 8fd70d013fa2263b0b11f5f128ba4f94f5570a9c) --- diff --git a/src/htsmsg_binary.c b/src/htsmsg_binary.c index 6d50a6df7..ef4ccf266 100644 --- a/src/htsmsg_binary.c +++ b/src/htsmsg_binary.c @@ -97,8 +97,11 @@ htsmsg_binary_des0(htsmsg_t *msg, const uint8_t *buf, size_t len) sub = &f->hmf_msg; TAILQ_INIT(&sub->hm_fields); sub->hm_data = NULL; - if(htsmsg_binary_des0(sub, buf, datalen) < 0) - return -1; + if(htsmsg_binary_des0(sub, buf, datalen) < 0) { + free(n); + free(f); + return -1; + } break; default: