From: Alberto Leiva Popper Date: Tue, 30 Sep 2025 18:38:26 +0000 (-0600) Subject: Patch memory leaks X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Ffort2;p=thirdparty%2FFORT-validator.git Patch memory leaks --- diff --git a/src/cache.c b/src/cache.c index ef5d6674..34f5e68b 100644 --- a/src/cache.c +++ b/src/cache.c @@ -170,6 +170,7 @@ delete_node(struct cache_table *tbl, struct cache_node *node, void *arg) free(node->key.id); free(node->path); + mftm_cleanup(&node->mft); rrdp_state_free(node->rrdp); free(node); } diff --git a/src/object/certificate.c b/src/object/certificate.c index 2255e988..181fde1f 100644 --- a/src/object/certificate.c +++ b/src/object/certificate.c @@ -823,6 +823,8 @@ __cer_cleanup(struct rpki_certificate *cer) X509_free(cer->x509); resources_destroy(cer->resources); exturis_cleanup(&cer->uris); + if (cer->tal) + tal_cleanup(cer->tal); rpp_cleanup(&cer->rpp); } diff --git a/src/object/tal.c b/src/object/tal.c index fb1b7989..5260dd9b 100644 --- a/src/object/tal.c +++ b/src/object/tal.c @@ -115,12 +115,13 @@ tal_create(char const *path) return tal; } -static void +void tal_cleanup(struct tal *tal) { if (atomic_fetch_sub(&tal->refcount, 1) == 1) { free(tal->spki); uris_cleanup(&tal->urls, uri_cleanup); + free(tal->path); free(tal); } } diff --git a/src/object/tal.h b/src/object/tal.h index d2b7a457..82a59c68 100644 --- a/src/object/tal.h +++ b/src/object/tal.h @@ -18,4 +18,6 @@ struct tal { int perform_standalone_validation(void); +void tal_cleanup(struct tal *); + #endif /* SRC_OBJECT_TAL_H_ */ diff --git a/src/rsync.c b/src/rsync.c index 4eba80f0..a25e45bb 100644 --- a/src/rsync.c +++ b/src/rsync.c @@ -865,4 +865,5 @@ rsync_teardown(void) spsk_cleanup(); wait_subprocess("rsync spawner", spawner); + pthread_join(srt, NULL); }