X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff.c;h=d442c66e961a614280b2a49f23d4cf89a878c0e2;hb=f01cae918feb564da8c7a286b32c7c917599acdd;hp=144f2aaba85682ef44d307d2b015fd918336879b;hpb=79d532c36a5d275ed237e196f36054f3c45d70aa;p=git.git diff --git a/diff.c b/diff.c index 144f2aaba..d442c66e9 100644 --- a/diff.c +++ b/diff.c @@ -919,7 +919,10 @@ static void free_diff_words_data(struct emit_callback *ecbdata) free (ecbdata->diff_words->minus.orig); free (ecbdata->diff_words->plus.text.ptr); free (ecbdata->diff_words->plus.orig); - free(ecbdata->diff_words->word_regex); + if (ecbdata->diff_words->word_regex) { + regfree(ecbdata->diff_words->word_regex); + free(ecbdata->diff_words->word_regex); + } free(ecbdata->diff_words); ecbdata->diff_words = NULL; } @@ -2093,6 +2096,8 @@ static void builtin_diffstat(const char *name_a, const char *name_b, memset(&xpp, 0, sizeof(xpp)); memset(&xecfg, 0, sizeof(xecfg)); xpp.flags = o->xdl_opts; + xecfg.ctxlen = o->context; + xecfg.interhunkctxlen = o->interhunkcontext; xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat, &xpp, &xecfg); }