[fix] Avoid dereference of null pointer
[fix] C89 compatibility.