X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Futils_ignorelist.c;h=532eb4b0029837318cf60a2adbecf901a2590b3a;hb=4c3b690f915df7b56170cee189096949adedefe5;hp=27eb987c94fec0c534a5e82417a36e904cbefee3;hpb=d5b0c6e1a85377658d8e2b35f07343cda106211f;p=collectd.git diff --git a/src/utils_ignorelist.c b/src/utils_ignorelist.c index 27eb987c..532eb4b0 100644 --- a/src/utils_ignorelist.c +++ b/src/utils_ignorelist.c @@ -285,7 +285,6 @@ int ignorelist_add (ignorelist_t *il, const char *entry) { int ret; size_t entry_len; - char *entry_copy; if (il == NULL) { @@ -306,6 +305,8 @@ int ignorelist_add (ignorelist_t *il, const char *entry) /* regex string is enclosed in "/.../" */ if ((entry_len > 2) && (entry[0] == '/') && entry[entry_len - 1] == '/') { + char *entry_copy; + /* We need to copy `entry' since it's const */ entry_copy = smalloc (entry_len); memset (entry_copy, '\0', entry_len);