From: Florian Forster Date: Mon, 18 Feb 2008 22:10:52 +0000 (+0100) Subject: liboconfig: Make sure that option-strings can always be freed. X-Git-Tag: collectd-4.3.0~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=04d6a987281022bfffb4d03e60d7d19c8135c4bd;p=collectd.git liboconfig: Make sure that option-strings can always be freed. This resolved a nasty crash when including files. --- diff --git a/src/liboconfig/parser.y b/src/liboconfig/parser.y index 5d7b98df..8df2c6e5 100644 --- a/src/liboconfig/parser.y +++ b/src/liboconfig/parser.y @@ -210,8 +210,8 @@ static char *unquote (const char *orig) if ((len < 2) || (ret[0] != '"') || (ret[len - 1] != '"')) return (ret); - ret++; len -= 2; + memmove (ret, ret + 1, len); ret[len] = '\0'; for (i = 0; i < len; i++)