summaryrefslogtreecommitdiff
path: root/src/bin/ethumb_client
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@datenfreihafen.org>2013-02-11 10:54:29 +0000
committerStefan Schmidt <stefan@datenfreihafen.org>2013-02-11 10:54:29 +0000
commit664b4b9db49267688ce7a44f91d2e91162f97d7c (patch)
treecbe7507e448ab19b36e828b2ad2beac96062833b /src/bin/ethumb_client
parent036a067a2ca2a9e02374d1369b8abd5caabc8bbb (diff)
efl/ethumb: Fix memory leak on error path in ethumb_slave.
When we hit an error with _ec_pipe_str_read we should clean up the strdup from previous calls to avoid leaks in the error case. SVN revision: 83817
Diffstat (limited to 'src/bin/ethumb_client')
-rw-r--r--src/bin/ethumb_client/ethumbd_slave.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/bin/ethumb_client/ethumbd_slave.c b/src/bin/ethumb_client/ethumbd_slave.c
index b1d319a305..4a328b8d50 100644
--- a/src/bin/ethumb_client/ethumbd_slave.c
+++ b/src/bin/ethumb_client/ethumbd_slave.c
@@ -262,13 +262,25 @@ _ec_op_generate(struct _Ethumbd_Child *ec)
262 return 0; 262 return 0;
263 r = _ec_pipe_str_read(ec, &key); 263 r = _ec_pipe_str_read(ec, &key);
264 if (!r) 264 if (!r)
265 return 0; 265 {
266 free(path);
267 return 0;
268 }
266 r = _ec_pipe_str_read(ec, &thumb_path); 269 r = _ec_pipe_str_read(ec, &thumb_path);
267 if (!r) 270 if (!r)
268 return 0; 271 {
272 free(path);
273 free(key);
274 return 0;
275 }
269 r = _ec_pipe_str_read(ec, &thumb_key); 276 r = _ec_pipe_str_read(ec, &thumb_key);
270 if (!r) 277 if (!r)
271 return 0; 278 {
279 free(path);
280 free(key);
281 free(thumb_path);
282 return 0;
283 }
272 284
273 ethumb_file_set(ec->ethumbt[idx], path, key); 285 ethumb_file_set(ec->ethumbt[idx], path, key);
274 ethumb_thumb_path_set(ec->ethumbt[idx], thumb_path, thumb_key); 286 ethumb_thumb_path_set(ec->ethumbt[idx], thumb_path, thumb_key);