Fixed memory leak

I've found this error by cppcheck, also it's find this:
```
[parser/base.c:647]: (error) Common realloc mistake: 'program' nulled but not freed upon failure
```