From a3a7e82ffd788f0caade9a3d857fcf48a4733670 Mon Sep 17 00:00:00 2001 From: Benny Morgan Date: Sun, 30 Jun 2013 21:09:09 +0200 Subject: [PATCH] - Fix memory leak - in case htmsg_binary_des0 return's something < 0, n and f was not free'd (cherry picked from commit 8fd70d013fa2263b0b11f5f128ba4f94f5570a9c) --- src/htsmsg_binary.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/htsmsg_binary.c b/src/htsmsg_binary.c index 6d50a6df..ef4ccf26 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: