From 25b67f99475a8ea3d96b9bc9e769daca32c249f6 Mon Sep 17 00:00:00 2001 From: roykingz Date: Wed, 6 Sep 2023 16:38:24 +0800 Subject: [PATCH] dpvs: fix all cfgfile parser malloc problems --- src/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.c b/src/parser.c index 6ac4313e..11491f7e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -392,9 +392,9 @@ void *set_value(vector_t tokens) str = VECTOR_SLOT(tokens, i); len += strlen(str); if (!alloc) - alloc = (char *) MALLOC(sizeof(char *) * (len + 1)); + alloc = (char *) MALLOC(sizeof(char) * (len + 1)); else { - alloc = REALLOC(alloc, sizeof(char *) * (len + 1)); + alloc = REALLOC(alloc, sizeof(char) * (len + 1)); tmp = VECTOR_SLOT(tokens, i - 1); if ( *str != '"' && *tmp != '"') strncat(alloc, " ", 1);