ethumb: Fix resource leak

Coverity reports a resource leak here as we were not freeing
'sanitized_path' inside the if statement.

Fixes CID1367502

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-01-25 08:56:38 -05:00
parent 8b2ca30eb5
commit f1c9088c14
1 changed files with 5 additions and 1 deletions

View File

@ -844,7 +844,11 @@ ethumb_file_set(Ethumb *e, const char *path, const char *key)
sanitized_path = eina_file_path_sanitize(path);
DBG("ethumb=%p, path=%s, key=%s", e, sanitized_path ? sanitized_path : "", key ? key : "");
if (sanitized_path && access(sanitized_path, R_OK)) return EINA_FALSE;
if (sanitized_path && access(sanitized_path, R_OK))
{
free(sanitized_path);
return EINA_FALSE;
}
eina_stringshare_replace(&e->src_hash, NULL);
eina_stringshare_replace(&e->src_path, sanitized_path);