From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=MIME_QP_LONG_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16101 invoked from network); 14 Nov 2022 21:47:40 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 14 Nov 2022 21:47:40 -0000 Received: from vultr.musolino.id.au ([45.76.123.158]) by 9front; Mon Nov 14 16:46:08 -0500 2022 Received: from smtpclient.apple ([2.198.154.50]) by vultr; Tue Nov 15 08:45:56 +1100 2022 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Alex Musolino Mime-Version: 1.0 (1.0) Date: Mon, 14 Nov 2022 22:45:48 +0100 Message-Id: <120DA5D8-E60E-4E6B-8E14-AFAE1D219D4F@musolino.id.au> References: In-Reply-To: To: 9front@9front.org X-Mailer: iPhone Mail (19G82) List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: content-addressed structured session enhancement service backend Subject: Re: [9front] auth_getkey: Fix a memory leak Reply-To: 9front@9front.org Precedence: bulk > diff 0e9c5f30eabbf213023658efb863dbaf6a608a51 uncommitted > --- a/sys/src/libauth/auth_getkey.c > +++ b/sys/src/libauth/auth_getkey.c > @@ -25,6 +25,7 @@ > werrstr("auth_getkey: /factotum may be bad: didn't get key %s", par= ams); > return -1; > } > + free(d); > switch(pid =3D fork()){ > case -1: > werrstr("can't fork for %s: %r", name); Good find, but we need to free the Dir in the =E2=80=9C/factotum may be bad=E2= =80=9D case too. Just latch the type and free the Dir unconditionally before= checking the type.=