Error in `event_demon': free(): invalid pointer: 0xf6e8a4f4