From: Benny Morgan Date: Sun, 30 Jun 2013 19:49:08 +0000 (+0200) Subject: - Fix - buf is assigned to to cm->cm_data with is defined 'uint8_t cm_data[CWS_NETMS... X-Git-Tag: 3.4patch1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=879f0c10597b1e6d526c344f0c90168f5df7ddd3;p=thirdparty%2Ftvheadend.git - Fix - buf is assigned to to cm->cm_data with is defined 'uint8_t cm_data[CWS_NETMSGSIZE];' part of the cwc_message_t, never malloc'd and should be free'd (cherry picked from commit 61491f394a92bfe20b18b61d2a130bf3a670efdc) --- diff --git a/src/cwc.c b/src/cwc.c index 7308a1792..afdb51eb3 100644 --- a/src/cwc.c +++ b/src/cwc.c @@ -497,7 +497,6 @@ cwc_send_msg(cwc_t *cwc, const uint8_t *msg, size_t len, int sid, int enq) buf[5] = sid; if((len = des_encrypt(buf, len, cwc)) <= 0) { - free(buf); free(cm); return -1; } diff --git a/src/filebundle.c b/src/filebundle.c index 295ed00fa..0ea7f324f 100644 --- a/src/filebundle.c +++ b/src/filebundle.c @@ -78,18 +78,16 @@ static uint8_t *_fb_inflate ( const uint8_t *data, size_t size, size_t orig ) { int err; z_stream zstr; - uint8_t *bufin, *bufout; + uint8_t *bufout; /* Setup buffers */ - bufin = malloc(size); bufout = malloc(orig); - memcpy(bufin, data, size); /* Setup zlib */ memset(&zstr, 0, sizeof(zstr)); inflateInit2(&zstr, 31); zstr.avail_in = size; - zstr.next_in = bufin; + zstr.next_in = data; zstr.avail_out = orig; zstr.next_out = bufout; @@ -99,7 +97,7 @@ static uint8_t *_fb_inflate ( const uint8_t *data, size_t size, size_t orig ) free(bufout); bufout = NULL; } - free(bufin); + inflateEnd(&zstr); return bufout;