Fix possible memory leak.

Dynamic memory stored in 'ptr2' allocated through function 'malloc' at
line 653 can be lost at line 1022. Also there is one similar error on
line 1029.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>
This commit is contained in:
Christopher Michael 2013-02-19 11:39:52 +00:00 committed by Stefan Schmidt
parent d33ddb5af9
commit 7f7f7f7c1f
1 changed files with 2 additions and 0 deletions

View File

@ -1018,6 +1018,7 @@ done:
{
jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
if (ptr2) free(ptr2);
*error = CSERVE2_NONE;
return EINA_FALSE;
}
@ -1025,6 +1026,7 @@ done:
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
if (ptr2) free(ptr2);
*error = CSERVE2_NONE;
return EINA_TRUE;
}