eina_debug: do not leak a spinlock when the path is not given

This commit is contained in:
Marcel Hollerbach 2017-03-18 22:06:30 +01:00
parent 7b687c1a25
commit 12d01c1259
1 changed files with 5 additions and 1 deletions

View File

@ -104,7 +104,11 @@ _eina_debug_file_get(const char *fname)
const char *p;
const char *pathstr = getenv("PATH");
if (!pathstr) return NULL;
if (!pathstr)
{
eina_spinlock_release(&_eina_debug_lock);
return NULL;
}
// dup the entire env as we will rpelace : with 0 bytes to break str
pathstrs = _eina_debug_chunk_strdup(pathstr);
for (n = 0, p = pathstr; *p;)