]> git.ipfire.org Git - thirdparty/git.git/commitdiff
list-objects-filter: don't memset after releasing filter struct
authorJeff King <peff@peff.net>
Sun, 11 Sep 2022 04:58:09 +0000 (00:58 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Sep 2022 15:38:58 +0000 (08:38 -0700)
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>
list-objects-filter-options.c

index 6cc4eb8e1c4b603f6f9b053b144e7f86e3a4be13..ea989db260d3888c75d173ed5ff9eb987a82079e 100644 (file)
@@ -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;
 }