Remove a potential bug in parser.c

Introduced a check to prevent a call to malloc with 0 as parameter.
Detected thanks to scan-build.