]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
- Fix memory leak - in case htmsg_binary_des0 return's something < 0, n and f was...
authorBenny Morgan <benny@zuragon.com>
Sun, 30 Jun 2013 19:09:09 +0000 (21:09 +0200)
committerAdam Sutton <dev@adamsutton.me.uk>
Thu, 11 Jul 2013 19:16:02 +0000 (20:16 +0100)
(cherry picked from commit 8fd70d013fa2263b0b11f5f128ba4f94f5570a9c)

src/htsmsg_binary.c

index 6d50a6df7df80f927ee76ec5ccfdf718024ef693..ef4ccf266700023accd7b92ee2de2a8695c9a085 100644 (file)
@@ -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: