since asprintf strp will be undefined it is better to reset to NULL before go and clean up. Otherwise we may free wrong memory area