Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
rpki-client: free the msgbufs in main
To:
tech@openbsd.org
Date:
Wed, 31 Dec 2025 10:43:17 +0100

Download raw body.

Thread
These are four sizeable allocations (64k each) that running in filemode
with MALLOC_OPTIONS=-D shows. Not really an issue but since we also
close the corresponding file descriptors, we should probably also
release these.

The remaining things flagged by -D in filemode are the global OIDs
from x509_init_oid() and the tals[] from tal_load_default().

Index: main.c
===================================================================
RCS file: /cvs/src/usr.sbin/rpki-client/main.c,v
diff -u -p -r1.302 main.c
--- main.c	13 Nov 2025 15:18:53 -0000	1.302
+++ main.c	31 Dec 2025 09:37:16 -0000
@@ -1485,9 +1485,15 @@ main(int argc, char *argv[])
 	 */
 
 	close(procfd);
+	msgbuf_free(procq);
 	close(rsyncfd);
+	msgbuf_free(rsyncq);
 	close(httpfd);
+	msgbuf_free(httpq);
 	close(rrdpfd);
+	msgbuf_free(rrdpq);
+	procq = rsyncq = httpq = rrdpq = NULL;
+	memset(queues, 0, sizeof(queues));
 
 	rc = 0;
 	for (;;) {