aboutsummaryrefslogtreecommitdiff
path: root/src/engine.c
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-07-29 21:54:18 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-07-29 21:54:18 +0530
commit0db7cca960bede061b0d7f4ee45df995a0eb02ab (patch)
treefa5face89fe525a1b7476e7d7e77e62325d0fa3d /src/engine.c
parent2b2c8a0ad2dc9a087bdb3987ecfc126ff9500914 (diff)
config,engine,filehandler: add and wrap with helper function (memory leak)
Diffstat (limited to 'src/engine.c')
-rw-r--r--src/engine.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/engine.c b/src/engine.c
index 9c2ed45..fa13834 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -132,9 +132,7 @@ handle_eachdo(char **buffer, key_match_t *match, directive_t *directive)
directive_t *directive = list_get(directives, i);
switch (directive->type) {
case _RAW: {
- ptr_wrapper_t *_wrapper = wrap_ptr(strdup(directive->operands));
- list_add(atoms, _wrapper);
- free(_wrapper);
+ list_wrap_and_add(atoms, strdup(directive->operands));
length += strlen(directive->operands);
break;
}
@@ -145,9 +143,7 @@ handle_eachdo(char **buffer, key_match_t *match, directive_t *directive)
config->keys, config->values, (char *) directive->operands);
if (key_wrp != NULL) {
- ptr_wrapper_t *_wrapper = wrap_ptr(strdup(key_wrp->ptr));
- list_add(atoms, _wrapper);
- free(_wrapper);
+ list_wrap_and_add(atoms, strdup(key_wrp->ptr));
length += strlen(key_wrp->ptr);
}