On Mon, Mar 08, 2021 at 06:36:15PM +0000, Andrzej Hunt via GitGitGadget wrote: > dwim_ref() allocs a new string into ref. Instead of setting to NULL to discard > it, we can FREE_AND_NULL. > [...] > dwim_ref(rev, strlen(rev), &dummy, &ref, 0); > if (ref && !starts_with(ref, "refs/")) > - ref = NULL; > + FREE_AND_NULL(ref); Yeah, this seems like a perfect solution for this case. -Peff