From: Jeff King Date: Sun, 11 Sep 2022 04:58:09 +0000 (-0400) Subject: list-objects-filter: don't memset after releasing filter struct X-Git-Tag: v2.38.0-rc1~16^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e40d906449950c140ba1e081b647c708d6d2979e;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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; }