summaryrefslogtreecommitdiff
path: root/parse-options-cb.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-10-28 09:01:23 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-10-28 09:01:23 -0700
commitc8fd2201756f9cd10a796311a1b25d7a2ab2a3b9 (patch)
tree6654ec0ab1a53959fe62fa526445efe71deb0dfb /parse-options-cb.c
parentMerge branch 'jc/diff-unique-abbrev-comments' into maint (diff)
parentuse strbuf_add_unique_abbrev() for adding short hashes, part 3 (diff)
downloadtgif-c8fd2201756f9cd10a796311a1b25d7a2ab2a3b9.tar.xz
Merge branch 'rs/cocci' into maint
Code cleanup. * rs/cocci: use strbuf_add_unique_abbrev() for adding short hashes, part 3 remove unnecessary NULL check before free(3) coccicheck: make transformation for strbuf_addf(sb, "...") more precise use strbuf_add_unique_abbrev() for adding short hashes, part 2 use strbuf_addstr() instead of strbuf_addf() with "%s", part 2 gitignore: ignore output files of coccicheck make target use strbuf_addstr() for adding constant strings to a strbuf, part 2 add coccicheck make target contrib/coccinelle: fix semantic patch for oid_to_hex_r()
Diffstat (limited to 'parse-options-cb.c')
-rw-r--r--parse-options-cb.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/parse-options-cb.c b/parse-options-cb.c
index 9667bc75a0..16818830e9 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -199,8 +199,7 @@ int parse_opt_passthru(const struct option *opt, const char *arg, int unset)
if (recreate_opt(&sb, opt, arg, unset) < 0)
return -1;
- if (*opt_value)
- free(*opt_value);
+ free(*opt_value);
*opt_value = strbuf_detach(&sb, NULL);