Skip to content

Commit e40d906

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7522bb9 commit e40d906

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

list-objects-filter-options.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,8 @@ static int parse_combine_filter(
187187

188188
cleanup:
189189
strbuf_list_free(subspecs);
190-
if (result) {
190+
if (result)
191191
list_objects_filter_release(filter_options);
192-
memset(filter_options, 0, sizeof(*filter_options));
193-
}
194192
return result;
195193
}
196194

0 commit comments

Comments
 (0)