diff options
author | Brandon Casey <drafnel@gmail.com> | 2010-09-09 14:02:45 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-09 17:18:04 -0700 |
commit | ef5644ea6ecec4ee6d6254612af2ed58499ac2fe (patch) | |
tree | 692beb9f7a48a4f74a74a22b7f39095d1d3e8db4 | |
parent | revert: Fix trivial comment style issue (diff) | |
download | tgif-ef5644ea6ecec4ee6d6254612af2ed58499ac2fe.tar.xz |
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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |