how about that you don't pass in NULL and then assume that malloc can't fail inside krb5_appdefault_string (really the only reason I think you are doing this)