eina_vpath_vdg: free locally allocated memory before return

The eina_vpath_resolve could allocate memory and return it.
But the eina_xdg_env_init does not release it.

*Detected by static analysis with the Coverity
Differential Revision: https://phab.enlightenment.org/D7066
This commit is contained in:
Shinwoo Kim 2018-09-21 03:11:24 +00:00 committed by Marcel Hollerbach
parent 6a8f2ce863
commit fe036fd67f
1 changed files with 2 additions and 2 deletions

View File

@ -15,10 +15,10 @@ eina_xdg_env_init(void)
{
char buf[PATH_MAX];
char *s;
const char *home;
char home[PATH_MAX];
Eina_Vpath_Interface_User user;
home = eina_vpath_resolve("(:home:)/");
eina_vpath_resolve_snprintf(home, sizeof(home), "(:home:)/");
memset(&user, 0, sizeof(Eina_Vpath_Interface_User));