9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Josiah Frentsos <jfrent@tilde.team>
To: 9front@9front.org
Subject: [9front] lock: Fix some memory leaks
Date: Fri, 20 Jan 2023 19:17:26 -0500	[thread overview]
Message-ID: <Y8svFsDWIl5YSy3u@quark.home.arpa> (raw)

diff bb36ba0617b5aa8263ea9b5ece8c1a5249fedc86 uncommitted
--- a/sys/src/cmd/lock.c
+++ b/sys/src/cmd/lock.c
@@ -35,6 +35,7 @@
 		}
 		if (w->pid == pid)
 			return w;
+		free(w);
 	}
 }
 
@@ -141,7 +142,8 @@
 		error("wait");
 
 	postnote(PNPROC, lckpid, "die");
-	waitfor(lckpid);
+	free(waitfor(lckpid));
+
 	if(w->msg[0]){
 		p = utfrune(w->msg, ':');
 		if(p && p[1])

             reply	other threads:[~2023-01-21  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-21  0:17 Josiah Frentsos [this message]
2023-01-21  7:55 ` Steve Simon
2023-01-22  0:36   ` Dan Cross
2023-01-22  7:09     ` Benjamin Purcell
2023-01-22  8:11       ` Steve Simon
2023-01-22 20:46 ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8svFsDWIl5YSy3u@quark.home.arpa \
    --to=jfrent@tilde.team \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).