Skip to content

Commit

Permalink
Fix memory leak in deflate decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
gigony committed May 19, 2021
1 parent bc3687c commit 84b079a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/plugins/cucim.kit.cuslide/src/cuslide/deflate/deflate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ bool decode_deflate(int fd,
size_t out_size;
libdeflate_zlib_decompress(d, deflate_buf, size /*in_nbytes*/, *dest, dest_nbytes /*out_nbytes_avail*/, &out_size);

if (fd != -1)
{
free(deflate_buf);
}

libdeflate_free_decompressor(d);
return true;
}
Expand Down

0 comments on commit 84b079a

Please sign in to comment.