regexec.c: Eliminate a malloc/free

This uses an C automatic variable instead of a malloc and free.