summaryrefslogtreecommitdiff
path: root/usr.sbin/rpki-client/mft.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-05-15 09:19:49 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-05-15 09:19:49 +0000
commit83445d02cf0722a8e0505a59fa60228f2de07ccb (patch)
tree7577cbbad8b1adbf731ec004e541ce1093394761 /usr.sbin/rpki-client/mft.c
parent8671dcbed1a771edaa12054ee24f167f5260fb40 (diff)
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
Diffstat (limited to 'usr.sbin/rpki-client/mft.c')
-rw-r--r--usr.sbin/rpki-client/mft.c14
1 files changed, 7 insertions, 7 deletions
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 <tb@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -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);
}