A wrong check for realloc failure will cause a segfault, on addition of new rules, because the old pointer address is still left intact, even if it was freed.