Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Casey <drafnel@gmail.com>2010-09-09 23:02:45 +0400
committerJunio C Hamano <gitster@pobox.com>2010-09-10 04:18:04 +0400
commitef5644ea6ecec4ee6d6254612af2ed58499ac2fe (patch)
tree692beb9f7a48a4f74a74a22b7f39095d1d3e8db4
parent04df568be53c42d07aea393effc7c5653f245d9a (diff)
diff.c: call regfree to free memory allocated by regcomp when necessary
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 93004922de..19b5bf63ed 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;
}