From: Brandon Casey Date: Thu, 9 Sep 2010 19:02:45 +0000 (-0500) Subject: diff.c: call regfree to free memory allocated by regcomp when necessary X-Git-Tag: v1.7.3-rc1~3^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ef5644ea6ecec4ee6d6254612af2ed58499ac2fe;p=git.git diff.c: call regfree to free memory allocated by regcomp when necessary Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- diff --git a/diff.c b/diff.c index 93004922d..19b5bf63e 100644 --- a/diff.c +++ b/diff.c @@ -912,7 +912,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; }