summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-10-02 07:18:39 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-10-02 07:18:39 (GMT)
commitbbe9de65a14a7940572494f143b6faf3d1353d26 (patch)
tree8ecd74e2479731ea92f430a4460e35d3380e748a
parent1b991b5c66cc44b6f93a14c1c265683074224004 (diff)
Fix memory leaks.
-rw-r--r--src/analysis/scan/core.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/analysis/scan/core.c b/src/analysis/scan/core.c
index 6316a53..7b11504 100644
--- a/src/analysis/scan/core.c
+++ b/src/analysis/scan/core.c
@@ -128,12 +128,14 @@ bool load_all_known_scan_token_modifiers(void)
result = true;
-#define REGISTER_SCAN_MODIFIER(m) \
- ({ \
- bool __status; \
- __status = register_scan_token_modifier(m); \
- g_object_unref(G_OBJECT(m)); \
- __status; \
+#define REGISTER_SCAN_MODIFIER(m) \
+ ({ \
+ GScanTokenModifier *__mod; \
+ bool __status; \
+ __mod = m; \
+ __status = register_scan_token_modifier(__mod); \
+ g_object_unref(G_OBJECT(__mod)); \
+ __status; \
})
if (result) result = REGISTER_SCAN_MODIFIER(g_scan_hex_modifier_new());
@@ -234,12 +236,14 @@ bool populate_main_scan_namespace(GScanNamespace *space)
result = true;
-#define REGISTER_FUNC(s, f) \
- ({ \
- bool __result; \
- __result = g_scan_namespace_register_item(s, f); \
- g_object_unref(G_OBJECT(f)); \
- __result; \
+#define REGISTER_FUNC(s, f) \
+ ({ \
+ GRegisteredItem *__item; \
+ bool __result; \
+ __item = f; \
+ __result = g_scan_namespace_register_item(s, __item); \
+ g_object_unref(G_OBJECT(__item)); \
+ __result; \
})
if (result) result = REGISTER_FUNC(space, g_scan_count_function_new());