summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2011-07-25 15:54:30 +0000
committerGreg Hudson <ghudson@mit.edu>2011-07-25 15:54:30 +0000
commit91d18671def148e2c4e518fb8927e6222cabaa4a (patch)
treebdb5814a4c1c9c3d2e278e9ddaa6668c707b86d7 /src/util
parent134b3568249d3cda1050be34474b5c54dc7598f2 (diff)
downloadkrb5-91d18671def148e2c4e518fb8927e6222cabaa4a.tar.gz
krb5-91d18671def148e2c4e518fb8927e6222cabaa4a.tar.xz
krb5-91d18671def148e2c4e518fb8927e6222cabaa4a.zip
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
Diffstat (limited to 'src/util')
-rw-r--r--src/util/profile/prof_get.c8
1 files changed, 8 insertions, 0 deletions
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;