Visual Studio code analysis picked this up, a C6308.
In the function get_parser, at the line:
casechars = (char *) realloc(casechars, strlen(casechars) + strlen(wordchars) + 1);
...if realloc fails, casechars is assigned NULL, and the address of the original allocation is clobbered, thus leaking the memory.
C6308 Realloc leak
337 'realloc' might return null pointer: assigning null pointer to 'casechars', which is passed as an argument to 'realloc', will cause the original memory block to be leaked.