X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff.c;h=9a5c77c13ff3406a85e8a94f309a639529f2d88b;hb=14d872987a270f383e20dc183f4a960cca0f0f36;hp=144f2aaba85682ef44d307d2b015fd918336879b;hpb=b9f171cc3b3f7f528acf672b5fef7e95b153213b;p=git.git diff --git a/diff.c b/diff.c index 144f2aaba..9a5c77c13 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; }