summaryrefslogtreecommitdiff
path: root/src/analysis/scan/patterns
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-11-01 21:36:50 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-11-01 21:36:50 (GMT)
commitce33112cf8c913635402cb8b6d127f9ac9f2b6b5 (patch)
tree731eaf0f50df1cc8033decbfce879b51ce5757e9 /src/analysis/scan/patterns
parent4eebf4a8752464691053fa3706ea6be9413676fa (diff)
Fix various memory leaks.
Diffstat (limited to 'src/analysis/scan/patterns')
-rw-r--r--src/analysis/scan/patterns/backends/acism.c15
-rw-r--r--src/analysis/scan/patterns/token.c2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/analysis/scan/patterns/backends/acism.c b/src/analysis/scan/patterns/backends/acism.c
index 97f8561..70e9a42 100644
--- a/src/analysis/scan/patterns/backends/acism.c
+++ b/src/analysis/scan/patterns/backends/acism.c
@@ -217,6 +217,21 @@ static void g_acism_backend_dispose(GAcismBackend *backend)
static void g_acism_backend_finalize(GAcismBackend *backend)
{
+ if (backend->sources != NULL)
+ free(backend->sources);
+
+ if (backend->nodes != NULL)
+ free(backend->nodes);
+
+ if (backend->bitmap_usage != NULL)
+ delete_bit_field(backend->bitmap_usage);
+
+ if (backend->states != NULL)
+ free(backend->states);
+
+ if (backend->pids != NULL)
+ free(backend->pids);
+
G_OBJECT_CLASS(g_acism_backend_parent_class)->finalize(G_OBJECT(backend));
}
diff --git a/src/analysis/scan/patterns/token.c b/src/analysis/scan/patterns/token.c
index 030e4a1..e5eb287 100644
--- a/src/analysis/scan/patterns/token.c
+++ b/src/analysis/scan/patterns/token.c
@@ -141,6 +141,8 @@ static void g_bytes_token_init(GBytesToken *token)
static void g_bytes_token_dispose(GBytesToken *token)
{
+ g_clear_object(&token->root);
+
G_OBJECT_CLASS(g_bytes_token_parent_class)->dispose(G_OBJECT(token));
}