grep: plug a trivial memory leak
[gitweb.git] / builtin / grep.c
index 9304c33e75051baa65ee02d1daa03c361e25339e..1b642b70e7e6fb2108fc296ea5a13b803d2b743e 100644 (file)
@@ -1293,6 +1293,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
                hit |= wait_all();
        if (hit && show_in_pager)
                run_pager(&opt, prefix);
+       clear_pathspec(&pathspec);
        free_grep_patterns(&opt);
        return !hit;
 }