summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjiin.moon <jiin.moon@samsung.com>2016-09-20 14:22:33 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-09-20 15:01:48 -0700
commit8272d1492796657978c5591971768d37d4e15a7e (patch)
tree598c34da93dd60d787e877326773d15e9ba72bba /src
parentb437bfb3feee9db3b523a8d3c8deb3bc20b1aaa8 (diff)
eet: fix memory leak
Summary: If ef is null, have to return before _set_material_to_eet_file_from_mesh api. New momory will be allocated in the api. Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4305 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/model_savers/eet/evas_model_save_eet.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/modules/evas/model_savers/eet/evas_model_save_eet.c b/src/modules/evas/model_savers/eet/evas_model_save_eet.c
index a5878dc7b4..c752dd39a4 100644
--- a/src/modules/evas/model_savers/eet/evas_model_save_eet.c
+++ b/src/modules/evas/model_savers/eet/evas_model_save_eet.c
@@ -156,6 +156,14 @@ evas_model_save_file_eet(const Evas_Canvas3D_Mesh *mesh,
156 eet_init(); 156 eet_init();
157 157
158 ef = eet_open(file, EET_FILE_MODE_WRITE); 158 ef = eet_open(file, EET_FILE_MODE_WRITE);
159 if (ef == NULL)
160 {
161 ERR("Opening of file is failed.");
162 free(eet_mesh);
163 free(eet_header);
164 eet_shutdown();
165 return;
166 }
159 167
160 _file_descriptor = _evas_canvas3d_eet_file_get(); 168 _file_descriptor = _evas_canvas3d_eet_file_get();
161 169
@@ -181,15 +189,6 @@ evas_model_save_file_eet(const Evas_Canvas3D_Mesh *mesh,
181 _set_material_to_eet_file_from_mesh(eet_mesh, eet_header, f); 189 _set_material_to_eet_file_from_mesh(eet_mesh, eet_header, f);
182 _set_frame_to_eet_file_from_mesh(eet_mesh); 190 _set_frame_to_eet_file_from_mesh(eet_mesh);
183 191
184 if (ef == NULL)
185 {
186 ERR("Opening of file is failed.");
187 free(eet_mesh);
188 free(eet_header);
189
190 goto on_error;
191 }
192
193 eet_file->mesh = eet_mesh; 192 eet_file->mesh = eet_mesh;
194 eet_file->header = eet_header; 193 eet_file->header = eet_header;
195 194