From: tb Date: Wed, 15 May 2024 09:19:48 +0000 (+0000) Subject: rpki-client: plug leak of the crl path X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a9a51c4fbf17045807293886a1e563c471d45101;p=openbsd rpki-client: plug leak of the crl path also, drop an unnecessary NULL check and make freeing have the same order as the struct field so auditing for leaks is easier. ok claudio --- diff --git a/usr.sbin/rpki-client/mft.c b/usr.sbin/rpki-client/mft.c index 024dd7c8bcb..8b6bf28d01e 100644 --- a/usr.sbin/rpki-client/mft.c +++ b/usr.sbin/rpki-client/mft.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mft.c,v 1.113 2024/04/20 15:45:41 job Exp $ */ +/* $OpenBSD: mft.c,v 1.114 2024/05/15 09:19:48 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * Copyright (c) 2019 Kristaps Dzonsons @@ -512,17 +512,17 @@ mft_free(struct mft *p) if (p == NULL) return; - if (p->files != NULL) - for (i = 0; i < p->filesz; i++) - free(p->files[i].file); + for (i = 0; i < p->filesz; i++) + free(p->files[i].file); + free(p->path); + free(p->files); + free(p->seqnum); free(p->aia); free(p->aki); free(p->sia); free(p->ski); - free(p->path); - free(p->files); - free(p->seqnum); + free(p->crl); free(p); }