diff --git a/historic/jam/src/builtins.c b/historic/jam/src/builtins.c index 9889bb15e..cbe42fea6 100644 --- a/historic/jam/src/builtins.c +++ b/historic/jam/src/builtins.c @@ -858,7 +858,7 @@ LIST * builtin_split_by_characters( PARSE * parse, FRAME * frame ) LIST * result = 0; - char* s = l1->string; + char* s = strdup (l1->string); char* delimiters = l2->string; char* t; @@ -869,6 +869,8 @@ LIST * builtin_split_by_characters( PARSE * parse, FRAME * frame ) t = strtok (NULL, delimiters); } + free (s); + return result; }