summaryrefslogtreecommitdiff
path: root/parse-options-cb.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-10-17 13:25:21 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-10-17 13:25:21 -0700
commit69e6544998892a2bd3c785cd238c786da40cf6a3 (patch)
tree5226289723f43db878429658b27a89b4ad23ee57 /parse-options-cb.c
parentMerge branch 'js/regexec-buf' (diff)
parentuse strbuf_add_unique_abbrev() for adding short hashes, part 3 (diff)
downloadtgif-69e6544998892a2bd3c785cd238c786da40cf6a3.tar.xz
Merge branch 'rs/cocci'
Code cleanup. * rs/cocci: use strbuf_add_unique_abbrev() for adding short hashes, part 3 remove unnecessary NULL check before free(3)
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 b5d920914e..b7d8f7dcb2 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -211,8 +211,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);