ensure to initialize allocated pointer with NULL.
this could prevent some SEGVs.