cleanup: use malloc/strdup wraper, add a log and a die function, silence compiler...