aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ethumb_client/ethumbd_slave.c
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/ethumbd_slave.c
parentFix major memory stompage when using ecore_xcb_atom routines. (diff)
downloadefl-664b4b9db49267688ce7a44f91d2e91162f97d7c.tar.gz
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 '')
-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)
return 0;
r = _ec_pipe_str_read(ec, &key);
if (!r)
- return 0;
+ {
+ free(path);
+ return 0;
+ }
r = _ec_pipe_str_read(ec, &thumb_path);
if (!r)
- return 0;
+ {
+ free(path);
+ free(key);
+ return 0;
+ }
r = _ec_pipe_str_read(ec, &thumb_key);
if (!r)
- return 0;
+ {
+ free(path);
+ free(key);
+ free(thumb_path);
+ return 0;
+ }
ethumb_file_set(ec->ethumbt[idx], path, key);
ethumb_thumb_path_set(ec->ethumbt[idx], thumb_path, thumb_key);