diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-02-27 13:03:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-27 13:03:50 -0800 |
commit | 3d0a936f63f2f894b3986d96cdd8f2baae96150c (patch) | |
tree | f661256c3756d9d74ea2cd045115e5488f53388f /diff.c | |
parent | 60b188a9844cdcf865174c685a38acc053a9d43b (diff) | |
parent | 8e0f70033b2bd1679a6e5971978fdc3ee09bdb72 (diff) | |
download | git-3d0a936f63f2f894b3986d96cdd8f2baae96150c.tar.gz |
Merge branch 'jm/free'
* jm/free:
Avoid unnecessary "if-before-free" tests.
Conflicts:
builtin-branch.c
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -118,8 +118,7 @@ static int parse_funcname_pattern(const char *var, const char *ep, const char *v pp->next = funcname_pattern_list; funcname_pattern_list = pp; } - if (pp->pattern) - free(pp->pattern); + free(pp->pattern); pp->pattern = xstrdup(value); return 0; } @@ -492,10 +491,8 @@ static void free_diff_words_data(struct emit_callback *ecbdata) ecbdata->diff_words->plus.text.size) diff_words_show(ecbdata->diff_words); - if (ecbdata->diff_words->minus.text.ptr) - free (ecbdata->diff_words->minus.text.ptr); - if (ecbdata->diff_words->plus.text.ptr) - free (ecbdata->diff_words->plus.text.ptr); + free (ecbdata->diff_words->minus.text.ptr); + free (ecbdata->diff_words->plus.text.ptr); free(ecbdata->diff_words); ecbdata->diff_words = NULL; } |