Olof Fairbrook reports that git bundle create private.bundle main --no-such-option prints "error: unrecognized argument" and then jumps to the cleanup at the end of create_bundle().

That cleanup clears revs_copy.pending, but revs_copy is only filled from revs further down the function. The cleanup therefore reads uninitialized stack memory and may free a garbage pointer. He attributes this to commit 11ee9a75e7 (bundle: plug leaks in create_bundle(), 2024-06-11).

Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in object_array_clear() and in free(). Whether the command actually crashes depends on what the stack happens to hold.

The patch is at v1 and has no replies yet.