]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Patch memory leaks fort2
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 30 Sep 2025 18:38:26 +0000 (12:38 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 30 Sep 2025 18:38:26 +0000 (12:38 -0600)
src/cache.c
src/object/certificate.c
src/object/tal.c
src/object/tal.h
src/rsync.c

index ef5d667444e70efad97d143cc69c22e451e7226e..34f5e68b0dc7540c2959367ca21c87427b23771c 100644 (file)
@@ -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);
 }
index 2255e9882406df4f87bda4e5abccb9dcc88ae0d9..181fde1fb6200a682e4555e76a9765d79c49b0a1 100644 (file)
@@ -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);
 }
 
index fb1b7989f7db5f7fc9e6e7c04e105d8152848d14..5260dd9b9fcd1914e177f52030712d5aef259b11 100644 (file)
@@ -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);
        }
 }
index d2b7a457f6f7b0d97ad56f6d1d62f5e2355b9021..82a59c68c0f295f5c99a5223213314725afc227e 100644 (file)
@@ -18,4 +18,6 @@ struct tal {
 
 int perform_standalone_validation(void);
 
+void tal_cleanup(struct tal *);
+
 #endif /* SRC_OBJECT_TAL_H_ */
index 4eba80f075743c5833d1761ced7193c462d96c09..a25e45bb48f6c2aeb2485b32fd5d4901526d630f 100644 (file)
@@ -865,4 +865,5 @@ rsync_teardown(void)
 
        spsk_cleanup();
        wait_subprocess("rsync spawner", spawner);
+       pthread_join(srt, NULL);
 }