evas: handling memory leak on realloc failure.

Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Srivardhan Hebbar 2015-10-21 13:35:17 -07:00 committed by Cedric BAIL
parent c6c84ffa6f
commit be464e5843
1 changed files with 8 additions and 2 deletions

View File

@ -187,8 +187,14 @@ evas_common_pipe_begin(RGBA_Image *im)
needed_size = ((im->cache_entry.w / estimatex) + 1 ) * ((im->cache_entry.h / estimatey) + 1);
if (buf_size < needed_size)
{
buf = realloc(buf, sizeof (RGBA_Pipe_Thread_Info) * needed_size);
buf_size = needed_size;
RGBA_Pipe_Thread_Info *temp;
temp = realloc(buf, sizeof (RGBA_Pipe_Thread_Info) * needed_size);
if (temp)
{
buf = temp;
buf_size = needed_size;
}
}
info = buf;