diff options
author | Chris Michael <cp.michael@samsung.com> | 2013-07-08 08:01:58 +0100 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2013-07-08 08:01:58 +0100 |
commit | bb30cd58ce5e1e1ce171acf6ef51f530d31458ab (patch) | |
tree | 71ea45511407ecf683ffdc26c0c7839d8cfad94b /src/lib | |
parent | b0fa8b65639c5a8f72b29f8b86814224537ef936 (diff) |
We cannot use dname in the error message if we have already freed it
above, so fix. On a mkpath failure, print out the message, Then free
dname. Be sure to also free dname if we do not error.
NB: Fixes Coverity CID1039893
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ethumb/ethumb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ethumb/ethumb.c b/src/lib/ethumb/ethumb.c index ad49444031..eab57a2d8f 100644 --- a/src/lib/ethumb/ethumb.c +++ b/src/lib/ethumb/ethumb.c | |||
@@ -1354,12 +1354,13 @@ ethumb_image_save(Ethumb *e) | |||
1354 | 1354 | ||
1355 | dname = ecore_file_dir_get(e->thumb_path); | 1355 | dname = ecore_file_dir_get(e->thumb_path); |
1356 | r = ecore_file_mkpath(dname); | 1356 | r = ecore_file_mkpath(dname); |
1357 | free(dname); | ||
1358 | if (!r) | 1357 | if (!r) |
1359 | { | 1358 | { |
1360 | ERR("could not create directory '%s'", dname); | 1359 | ERR("could not create directory '%s'", dname); |
1360 | free(dname); | ||
1361 | return EINA_FALSE; | 1361 | return EINA_FALSE; |
1362 | } | 1362 | } |
1363 | free(dname); | ||
1363 | 1364 | ||
1364 | snprintf(flags, sizeof(flags), "quality=%d compress=%d", | 1365 | snprintf(flags, sizeof(flags), "quality=%d compress=%d", |
1365 | e->quality, e->compress); | 1366 | e->quality, e->compress); |