forked from enlightenment/efl
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:
parent
6a8f2ce863
commit
fe036fd67f
|
@ -15,10 +15,10 @@ eina_xdg_env_init(void)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
char *s;
|
char *s;
|
||||||
const char *home;
|
char home[PATH_MAX];
|
||||||
Eina_Vpath_Interface_User user;
|
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));
|
memset(&user, 0, sizeof(Eina_Vpath_Interface_User));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue