From: "Todd C. Miller" Subject: Re: Minor memory leak in dial_git() To: Christian Weisgerber Cc: gameoftrees@openbsd.org Date: Fri, 28 May 2021 14:31:46 -0600 On Fri, 28 May 2021 22:22:24 +0200, Christian Weisgerber wrote: > The sequence > > asprintf(&pkt, ...) > write(..., pkt, ...) > > asprintf(&pkt, ...) > write(..., pkt, ...) > > in dial_git() leaks a buffer. We could insert a free(pkt), but I > think it's simpler and clearer to create the packet in a single > asprintf(). This partially reverts commit 4312a498. Wouldn't it be simpler to use dprintf(3) instead of asprintf(3) + write(2)? - todd