]> Dogcows Code - chaz/openbox/blobdiff - obt/paths.c
free the path dirs
[chaz/openbox] / obt / paths.c
index e2e4859b8d94385053c1f50bcf46a172bdc71b5e..bd6c177a708a30c885dfca940d9dfb4d8f50d072 100644 (file)
@@ -126,7 +126,7 @@ static void find_uid_gid(uid_t *u, gid_t **g, guint *n)
     }
     endgrent();
 
-    qsort(*g, sizeof(gid_t), *n, gid_cmp);
+    qsort(*g, *n, sizeof(gid_t), gid_cmp);
 }
 
 ObtPaths* obt_paths_new(void)
@@ -231,6 +231,9 @@ void obt_paths_unref(ObtPaths *p)
         for (it = p->autostart_dirs; it; it = g_slist_next(it))
             g_free(it->data);
         g_slist_free(p->autostart_dirs);
+        for (it = p->exec_dirs; it; it = g_slist_next(it))
+            g_free(it->data);
+        g_slist_free(p->exec_dirs);
         g_free(p->config_home);
         g_free(p->data_home);
         g_free(p->cache_home);
@@ -331,7 +334,8 @@ static inline gboolean try_exec(const ObtPaths *const p,
     struct stat st;
     BSEARCH_SETUP(guint);
 
-    stat(path, &st);
+    if (stat(path, &st) != 0)
+        return FALSE;
 
     if (!S_ISREG(st.st_mode))
         return FALSE;
This page took 0.02253 seconds and 4 git commands to generate.