From: Greg Hudson Date: Mon, 25 Jul 2011 15:54:30 +0000 (+0000) Subject: Restore accessor behavior on null profiles X-Git-Tag: krb5-1.10-alpha1~331 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=91d18671def148e2c4e518fb8927e6222cabaa4a;p=krb5.git Restore accessor behavior on null profiles Prior to the pluggable configuration work, profile_get_values() and friends would return PROF_NO_PROFILE if called with a null profile. Restore that behavior. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25044 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/profile/prof_get.c b/src/util/profile/prof_get.c index f3bc31463..844d22689 100644 --- a/src/util/profile/prof_get.c +++ b/src/util/profile/prof_get.c @@ -161,6 +161,9 @@ profile_get_values(profile_t profile, const char *const *names, char *value; struct profile_string_list values; + *ret_values = NULL; + if (!profile) + return PROF_NO_PROFILE; if (profile->vt) return get_values_vt(profile, names, ret_values); @@ -222,6 +225,8 @@ errcode_t profile_get_value(profile_t profile, const char **names, char *value; *ret_value = NULL; + if (!profile) + return PROF_NO_PROFILE; if (profile->vt) return get_value_vt(profile, names, ret_value); @@ -483,6 +488,9 @@ profile_iterator_create(profile_t profile, const char *const *names, int flags, errcode_t retval; *ret_iter = NULL; + if (!profile) + return PROF_NO_PROFILE; + iter = malloc(sizeof(*iter)); if (iter == NULL) return ENOMEM;