Skip to content
Snippets Groups Projects
Commit 498624df authored by Tim Wickberg's avatar Tim Wickberg
Browse files

Fix leak of out_buf when file length is zero.

parent 54c9ac31
No related branches found
No related tags found
No related merge requests found
......@@ -507,12 +507,13 @@ static int _decompress_data_zlib(file_bcast_msg_t *req)
static int _decompress_data_lz4(file_bcast_msg_t *req)
{
#if HAVE_LZ4
char *out_buf = xmalloc(req->uncomp_len);
char *out_buf;
int out_len;
if (!req->block_len)
return 0;
out_buf = xmalloc(req->uncomp_len);
out_len = LZ4_decompress_safe(req->block, out_buf, req->block_len, req->uncomp_len);
xfree(req->block);
req->block = out_buf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment