Skip to content

Commit

Permalink
diff.c: call regfree to free memory allocated by regcomp when necessary
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Sep 10, 2010
1 parent 04df568 commit ef5644e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ef5644e

Please sign in to comment.