summaryrefslogtreecommitdiff
path: root/parse-options-cb.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-17 13:25:21 -0700
committerJunio C Hamano <gitster@pobox.com>2016-10-17 13:25:21 -0700
commit69e6544998892a2bd3c785cd238c786da40cf6a3 (patch)
tree5226289723f43db878429658b27a89b4ad23ee57 /parse-options-cb.c
parent9424bf27079a1262e42a2330283f7ab6c805267a (diff)
parenta94bb683970a111b467a36590ca36e52754ad504 (diff)
downloadgit-69e6544998892a2bd3c785cd238c786da40cf6a3.tar.gz
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);