efreetd cache - fix leak of strbuf when error conditions abort save

fix CID 1374951
This commit is contained in:
Carsten Haitzler 2017-07-23 18:11:26 +09:00
parent 91878f72f1
commit fceb86c865
1 changed files with 3 additions and 3 deletions

View File

@ -183,14 +183,14 @@ subdir_cache_save(void)
Eina_Tmpstr *tmpstr = NULL;
int tmpfd;
buf = eina_strbuf_new();
if (!buf) return;
// only if subdirs need saving... and we have subdirs.
if (!subdir_need_save) return;
if (!subdir_cache) return;
if (!subdir_cache->dirs) return;
buf = eina_strbuf_new();
if (!buf) return;
// save to tmp file first
eina_strbuf_append_printf(buf, "%s/efreet/subdirs_%s.eet.XXXXXX.cache",
efreet_cache_home_get(), efreet_hostname_get());