From: Brandon Casey Date: Thu, 09 Sep 2010 19:02:45 GMT Subject: [PATCH 1/4] diff.c: call regfree to free memory allocated by regcomp when necessary Message-ID: From: Brandon Casey Signed-off-by: Brandon Casey --- diff.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/diff.c b/diff.c index 144f2aa..9a5c77c 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; } -- 1.7.2.1