Merge branch 'js/plug-leaks' into maint
[gitweb.git] / compat / mingw.c
index 3fbfda5978b7bb715ab132283a69fa49384896e9..fe0e3ccd24887a830b99dabb9c66db668ba4f566 100644 (file)
@@ -961,8 +961,10 @@ static char **get_path_split(void)
                        ++n;
                }
        }
-       if (!n)
+       if (!n) {
+               free(envpath);
                return NULL;
+       }
 
        ALLOC_ARRAY(path, n + 1);
        p = envpath;