]> git.ipfire.org Git - thirdparty/git.git/blobdiff - combine-diff.c
fix segfault with git log -c --follow
[thirdparty/git.git] / combine-diff.c
index 7f6187f9cd2fc44540cddbcf4bb853231c57397c..21fd00ff6156f7eb7af6b74dd569325af3f37820 100644 (file)
@@ -1120,6 +1120,7 @@ void diff_tree_combined(const unsigned char *sha1,
        int i, num_paths, needsep, show_log_first, num_parent = parents->nr;
 
        diffopts = *opt;
+       diff_tree_setup_paths(diffopts.pathspec.raw, &diffopts);
        diffopts.output_format = DIFF_FORMAT_NO_OUTPUT;
        DIFF_OPT_SET(&diffopts, RECURSIVE);
        DIFF_OPT_CLR(&diffopts, ALLOW_EXTERNAL);
@@ -1187,6 +1188,8 @@ void diff_tree_combined(const unsigned char *sha1,
                paths = paths->next;
                free(tmp);
        }
+
+       diff_tree_release_paths(&diffopts);
 }
 
 void diff_tree_combined_merge(const struct commit *commit, int dense,