TWilmer / miniz

Automatically exported from code.google.com/p/miniz
0 stars 0 forks source link

Memory Leak in PNG write function #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call tdefl_write_image_to_png_file_in_memory_ex() in test code
2. run a memory leak detector

What is the expected output? What do you see instead?

There is a memory leak in tdefl_write_image_to_png_file_in_memory_ex()
out_buf.m_pBuf is not freed on success

What version of the product are you using? On what operating system?

miniz.c v1.15 
Windows 7 Pro x64

Please provide any additional information below.

Add MZ_FREE(out_buf.m_pBuf); before return statement (line 2827)

Original issue reported on code.google.com by Lok...@gmail.com on 14 Oct 2013 at 11:58

GoogleCodeExporter commented 9 years ago
Man, wish I hadn't posted this without thinking. out_buf.m_pBuf is the output...

Original comment by Lok...@gmail.com on 15 Oct 2013 at 12:02

GoogleCodeExporter commented 9 years ago
No worries - the more eyes on the code, the better..

Original comment by richge...@gmail.com on 15 Oct 2013 at 12:29