forked from enlightenment/efl
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:
parent
036a067a2c
commit
664b4b9db4
|
@ -262,13 +262,25 @@ _ec_op_generate(struct _Ethumbd_Child *ec)
|
||||||
return 0;
|
return 0;
|
||||||
r = _ec_pipe_str_read(ec, &key);
|
r = _ec_pipe_str_read(ec, &key);
|
||||||
if (!r)
|
if (!r)
|
||||||
return 0;
|
{
|
||||||
|
free(path);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
r = _ec_pipe_str_read(ec, &thumb_path);
|
r = _ec_pipe_str_read(ec, &thumb_path);
|
||||||
if (!r)
|
if (!r)
|
||||||
return 0;
|
{
|
||||||
|
free(path);
|
||||||
|
free(key);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
r = _ec_pipe_str_read(ec, &thumb_key);
|
r = _ec_pipe_str_read(ec, &thumb_key);
|
||||||
if (!r)
|
if (!r)
|
||||||
return 0;
|
{
|
||||||
|
free(path);
|
||||||
|
free(key);
|
||||||
|
free(thumb_path);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ethumb_file_set(ec->ethumbt[idx], path, key);
|
ethumb_file_set(ec->ethumbt[idx], path, key);
|
||||||
ethumb_thumb_path_set(ec->ethumbt[idx], thumb_path, thumb_key);
|
ethumb_thumb_path_set(ec->ethumbt[idx], thumb_path, thumb_key);
|
||||||
|
|
Loading…
Reference in New Issue