summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-09-10 00:29:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-09-10 00:29:40 (GMT)
commit8ac8cf5bc17ef11a9c5d51ab128ad010cb37c464 (patch)
tree7412604a665890a9ce4dbeaac0cca3406f2ba7ca /diff.c
parentbff42061214e17f342efc909c73f29bf66df51e9 (diff)
parent1b6ecbad3511b1aaa65172ef8b520dd3b5141614 (diff)
downloadgit-8ac8cf5bc17ef11a9c5d51ab128ad010cb37c464.zip
git-8ac8cf5bc17ef11a9c5d51ab128ad010cb37c464.tar.gz
git-8ac8cf5bc17ef11a9c5d51ab128ad010cb37c464.tar.bz2
Merge branch 'maint'
* maint: xdiff-interface.c: always trim trailing space from xfuncname matches diff.c: call regfree to free memory allocated by regcomp when necessary
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
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;
}