evas: fix possible memory leaks in e3d_drawable_texture_rendered_pixels_get

Summary:
@fix
CID: 1356243, 1356242, 1356242, 1356242

Reviewers: cedric, Hermet, raster

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4011

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Oleksandr Shcherbina 2016-06-08 13:58:28 -07:00 committed by Cedric BAIL
parent db79f8499c
commit 32d1f4b2e5
1 changed files with 3 additions and 1 deletions

View File

@ -1460,6 +1460,8 @@ e3d_drawable_texture_rendered_pixels_get(GLuint tex EINA_UNUSED, int x, int y, i
if (!datarowup || !datarowlow)
{
ERR("Not enough memory");
if (datarowup) free(datarowup);
if (datarowlow) free(datarowlow);
return;
}
for (j = 0; j < h / 2; j++)
@ -1467,7 +1469,7 @@ e3d_drawable_texture_rendered_pixels_get(GLuint tex EINA_UNUSED, int x, int y, i
bellow = h * w - width;
up = w + width;
for (i = w; i >= 0; i--)
for (i = w - 1; i >= 0; i--)
{
pixel = buffer[bellow];
datarowlow[i] = ((pixel & 0x000000ff) << 16) +