event.c: Fix potential leak on error.

 * Try to restore pointers as they should be...