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
This commit is contained in:
Stefan Schmidt 2013-02-11 10:54:29 +00:00
parent 036a067a2c
commit 664b4b9db4
1 changed files with 15 additions and 3 deletions

View File

@ -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);