summaryrefslogtreecommitdiffstats
path: root/core/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/parse.c')
-rw-r--r--core/parse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/parse.c b/core/parse.c
index 76b66733f..005a971e5 100644
--- a/core/parse.c
+++ b/core/parse.c
@@ -394,10 +394,16 @@ void userid_stop(void)
in_userid = false;
}
+/*
+ * Copy whitespace-trimmed string. Warning: the passed in string will be freed,
+ * therefore make sure to only pass in to NULL-initialized pointers or pointers
+ * to owned strings
+ */
void utf8_string(char *buffer, void *_res)
{
char **res = _res;
int size;
+ free(*res);
size = trimspace(buffer);
if(size)
*res = strdup(buffer);