Prevent error null pointer error

This fix prevents error that arise when the environement element
is not present in the html. It uses a self invocation function
in order to free pointers from memory when parsing is completed.
fix typo
new build
Merge pull request #2093 from DeuxHuitHuit/null-error

Null error in javascript on error pages