eina_debug: do not leak a spinlock when the path is not given
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Sat, 18 Mar 2017 21:06:30 +0000 (22:06 +0100)
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>
Sat, 18 Mar 2017 21:10:43 +0000 (22:10 +0100)
src/lib/eina/eina_debug_bt_file.c

index 59c87d8..66636e3 100644 (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;)