fix free of uninitialized buffer pointer on error in regexec