aboutsummaryrefslogtreecommitdiffstats
path: root/list-objects-filter-options.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2022-09-11 00:58:09 -0400
committerJunio C Hamano <gitster@pobox.com>2022-09-12 08:38:58 -0700
commite40d906449950c140ba1e081b647c708d6d2979e (patch)
treea82155481c9f6234f83e66ba471f2244e754819e /list-objects-filter-options.c
parent7522bb9bc90c6a05ae5f422df723e1cd562dd0bf (diff)
downloadgit-e40d906449950c140ba1e081b647c708d6d2979e.tar.gz
list-objects-filter: don't memset after releasing filter struct
If we see an error while parsing a "combine" filter, we call list_objects_filter_release() to free any allocated memory, and then use memset() to return the struct to a known state. But the release function already does that reinitializing. Doing it again is pointless. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects-filter-options.c')
-rw-r--r--list-objects-filter-options.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
index 6cc4eb8e1c..ea989db260 100644
--- a/list-objects-filter-options.c
+++ b/list-objects-filter-options.c
@@ -187,10 +187,8 @@ static int parse_combine_filter(
cleanup:
strbuf_list_free(subspecs);
- if (result) {
+ if (result)
list_objects_filter_release(filter_options);
- memset(filter_options, 0, sizeof(*filter_options));
- }
return result;
}