ensure to check NULL in malloc/realloc/strdup.
Merge branch 'null_check' into development