X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff.c;h=349a61d588bf65616875be59e8a5d86f0b18dd4f;hb=6440d3417c1d51a20014d4b6fc6c59bacfa87dab;hp=526f1980596887dff99b1236ce39a47b6bdb7215;hpb=77d1a520fb5b8ad8cc86228023f16a44b75c05d1;p=git.git diff --git a/diff.c b/diff.c index 526f19805..349a61d58 100644 --- a/diff.c +++ b/diff.c @@ -1008,11 +1008,13 @@ static const char *userdiff_word_regex(struct diff_filespec *one) } static void init_diff_words_data(struct emit_callback *ecbdata, - struct diff_options *o, + struct diff_options *orig_opts, struct diff_filespec *one, struct diff_filespec *two) { int i; + struct diff_options *o = xmalloc(sizeof(struct diff_options)); + memcpy(o, orig_opts, sizeof(struct diff_options)); ecbdata->diff_words = xcalloc(1, sizeof(struct diff_words_data)); @@ -1052,6 +1054,7 @@ static void free_diff_words_data(struct emit_callback *ecbdata) { if (ecbdata->diff_words) { diff_words_flush(ecbdata); + free (ecbdata->diff_words->opt); free (ecbdata->diff_words->minus.text.ptr); free (ecbdata->diff_words->minus.orig); free (ecbdata->diff_words->plus.text.ptr);