From: Kristoffer Haugsbakk Date: Fri, 19 Sep 2025 13:11:41 GMT Subject: Re: [BUG] git stash show -p with invalid option aborts with double-free in show_stash() (strvec_clear) Message-ID: <1321ff39-6f09-426a-aa75-939ef4e1ad93@app.fastmail.com> In-Reply-To: On Fri, Sep 19, 2025, at 12:18, Lauri Niskanen wrote: > What did you do before the bug happened? > > Create a repo and a stash entry, then invoke `git stash show -p` with > an invalid option: > > git init repro > cd repro > touch a > git add a > git commit -m init > echo x >> a > git stash > git stash show -p --invalid > > > What did you expect to happen? > > Git should print a usage / option error and exit cleanly without crashing. > > > What happened instead? > > free(): double free detected in tcache 2 This bisects to 748bd094 (builtin/stash: fix leak in `show_stash()`, 2024-06-11) for me. > GDB backtrace: >[snip] -- Kristoffer Haugsbakk