scm: fix avatar caching memory handling
This commit is contained in:
parent
f89442047a
commit
15a1529df0
|
@ -50,7 +50,8 @@ void _edi_scm_ui_screens_avatar_download_complete(void *data, const char *file,
|
|||
static void
|
||||
_edi_scm_ui_screens_avatar_load(Evas_Object *image, const char *email)
|
||||
{
|
||||
const char *tmp, *cache, *cachedir, *cacheparentdir;
|
||||
char *tmp, *tmp2;
|
||||
const char *cache, *cachedir, *cacheparentdir;
|
||||
|
||||
cache = _edi_scm_ui_avatar_cache_path_get(email);
|
||||
if (ecore_file_exists(cache))
|
||||
|
@ -59,9 +60,10 @@ _edi_scm_ui_screens_avatar_load(Evas_Object *image, const char *email)
|
|||
return;
|
||||
}
|
||||
|
||||
tmp = dirname((char *) cache);
|
||||
cachedir = strdup(tmp);
|
||||
cacheparentdir = dirname((char *) tmp);
|
||||
tmp = strdup(cache);
|
||||
cachedir = dirname(tmp);
|
||||
tmp2 = strdup(tmp);
|
||||
cacheparentdir = dirname(tmp2);
|
||||
if (!ecore_file_exists(cacheparentdir) && !ecore_file_mkdir(cacheparentdir))
|
||||
goto clear;
|
||||
|
||||
|
@ -73,7 +75,8 @@ _edi_scm_ui_screens_avatar_load(Evas_Object *image, const char *email)
|
|||
image, NULL);
|
||||
|
||||
clear:
|
||||
free((char *)cachedir);
|
||||
free(tmp2);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue