free the malloc'd str pointer