summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-10-21 13:35:17 -0700
committerCedric BAIL <cedric@osg.samsung.com>2015-10-21 13:40:01 -0700
commitbe464e5843dbf841386d070c44a0d7d8b6c59294 (patch)
tree3ae37639cd0fee3141a4a21e717dbd06910a5d50
parentc6c84ffa6fa47a53095adbcbdf1692990788d302 (diff)
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>
-rw-r--r--src/lib/evas/common/evas_pipe.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/evas/common/evas_pipe.c b/src/lib/evas/common/evas_pipe.c
index d04910d01d..e38a72ae74 100644
--- a/src/lib/evas/common/evas_pipe.c
+++ b/src/lib/evas/common/evas_pipe.c
@@ -187,8 +187,14 @@ evas_common_pipe_begin(RGBA_Image *im)
187 needed_size = ((im->cache_entry.w / estimatex) + 1 ) * ((im->cache_entry.h / estimatey) + 1); 187 needed_size = ((im->cache_entry.w / estimatex) + 1 ) * ((im->cache_entry.h / estimatey) + 1);
188 if (buf_size < needed_size) 188 if (buf_size < needed_size)
189 { 189 {
190 buf = realloc(buf, sizeof (RGBA_Pipe_Thread_Info) * needed_size); 190 RGBA_Pipe_Thread_Info *temp;
191 buf_size = needed_size; 191
192 temp = realloc(buf, sizeof (RGBA_Pipe_Thread_Info) * needed_size);
193 if (temp)
194 {
195 buf = temp;
196 buf_size = needed_size;
197 }
192 } 198 }
193 199
194 info = buf; 200 info = buf;