summaryrefslogtreecommitdiff
path: root/src/lib/ethumb
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-01-25 08:56:38 -0500
committerChris Michael <cp.michael@samsung.com>2017-01-25 09:09:38 -0500
commitf1c9088c14f2527fd9040c7b48f88d2597aeab10 (patch)
treea4169c12362d2cc036cd08bf2d48111705ab3401 /src/lib/ethumb
parent8b2ca30eb5bc112b47155cc3694be1aa39b1345f (diff)
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>
Diffstat (limited to 'src/lib/ethumb')
-rw-r--r--src/lib/ethumb/ethumb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ethumb/ethumb.c b/src/lib/ethumb/ethumb.c
index ef18564ff4..73ec5b9e0c 100644
--- a/src/lib/ethumb/ethumb.c
+++ b/src/lib/ethumb/ethumb.c
@@ -844,7 +844,11 @@ ethumb_file_set(Ethumb *e, const char *path, const char *key)
844 844
845 sanitized_path = eina_file_path_sanitize(path); 845 sanitized_path = eina_file_path_sanitize(path);
846 DBG("ethumb=%p, path=%s, key=%s", e, sanitized_path ? sanitized_path : "", key ? key : ""); 846 DBG("ethumb=%p, path=%s, key=%s", e, sanitized_path ? sanitized_path : "", key ? key : "");
847 if (sanitized_path && access(sanitized_path, R_OK)) return EINA_FALSE; 847 if (sanitized_path && access(sanitized_path, R_OK))
848 {
849 free(sanitized_path);
850 return EINA_FALSE;
851 }
848 852
849 eina_stringshare_replace(&e->src_hash, NULL); 853 eina_stringshare_replace(&e->src_hash, NULL);
850 eina_stringshare_replace(&e->src_path, sanitized_path); 854 eina_stringshare_replace(&e->src_path, sanitized_path);