use dup'ed string in fw3_parse_monthdays()
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 28 Feb 2013 13:07:22 +0000 (14:07 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 28 Feb 2013 13:07:42 +0000 (14:07 +0100)
options.c

index ff9a964..a35247f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -636,7 +636,7 @@ fw3_parse_monthdays(void *ptr, const char *val)
        if (!(s = strdup(val)))
                return false;
 
        if (!(s = strdup(val)))
                return false;
 
-       for (p = strtok((char *)val, " \t"); p; p = strtok(NULL, " \t"))
+       for (p = strtok(s, " \t"); p; p = strtok(NULL, " \t"))
        {
                d = strtoul(p, &p, 10);
 
        {
                d = strtoul(p, &p, 10);