fix critical memory management error for -s and -S options default tip

Sun, 19 Jul 2026 15:13:05 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 19 Jul 2026 15:13:05 +0200
changeset 109
4de447ff165b
parent 108
47be4044845b

fix critical memory management error for -s and -S options

src/arguments.c file | annotate | diff | comparison | revisions
--- a/src/arguments.c	Sun Jul 05 12:50:42 2026 +0200
+++ b/src/arguments.c	Sun Jul 19 15:13:05 2026 +0200
@@ -49,10 +49,11 @@
 
 void parse_csl(const char *csl, string_list *list) {
   if (csl != NULL) {
+    list->free_item = free;
     char *buf = strdup(csl);
     char *finder = strtok(buf, ",");
     while (finder != NULL) {
-      add_string(list, finder);
+      add_string(list, strdup(finder));
       finder = strtok(NULL, ",");
     }
     free(buf);

mercurial