plug-ins: fix a memory leak in file-png

Found using clang's scan-build.
This commit is contained in:
Michael Henning 2013-01-14 17:36:43 -05:00
parent f4bf93dac9
commit 14bb38da3f
1 changed files with 3 additions and 1 deletions

View File

@ -1868,7 +1868,9 @@ respin_cmap (png_structp pp,
*/
if (colors == 0)
{
before = g_new0 (guchar, 3);
before = g_newa (guchar, 3);
memset (before, 0, sizeof (guchar) * 3);
colors = 1;
}