On Fri, Jul 26, 2024 at 02:16:12PM +0200, Patrick Steinhardt wrote: > @@ -1892,5 +1895,16 @@ int cmd_stash(int argc, const char **argv, const char *prefix) > /* Assume 'stash push' */ > strvec_push(&args, "push"); > strvec_pushv(&args, argv); > - return !!push_stash(args.nr, args.v, prefix, 1); > + > + /* > + * `push_stash()` ends up modifying the array, which causes memory > + * leaks if we didn't copy the array here. > + */ > + DUP_ARRAY(args_copy, args.v, args.nr); > + > + ret = !!push_stash(args.nr, args_copy, prefix, 1); > + > + strvec_clear(&args); > + free(args_copy); > + return ret; > } OK, so this is the same pattern as we saw in the third patch of this series. I agree with Junio's comments in that sub-thread, but also that they are out-of-scope for the present series ;-). Looking good. Thanks, Taylor