From: Alexandra Ellwood Date: Thu, 9 Oct 2008 17:49:23 +0000 (+0000) Subject: kim_options_create sometimes returns KIM_OPTIONS_DEFAULT X-Git-Tag: krb5-1.7-alpha1~325 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=599a2fa44ec8d00eb632d6063220b43fb2455a52;p=krb5.git kim_options_create sometimes returns KIM_OPTIONS_DEFAULT ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20853 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kim/lib/kim_options.c b/src/kim/lib/kim_options.c index 08f1ddb6f..5d7e58ae5 100644 --- a/src/kim/lib/kim_options.c +++ b/src/kim/lib/kim_options.c @@ -91,6 +91,7 @@ kim_error kim_options_create (kim_options *out_options) { kim_error err = KIM_NO_ERROR; kim_preferences preferences = NULL; + kim_options options = KIM_OPTIONS_DEFAULT; if (!err && !out_options) { err = check_error (KIM_NULL_PARAMETER_ERR); } @@ -99,9 +100,19 @@ kim_error kim_options_create (kim_options *out_options) } if (!err) { - err = kim_preferences_get_options (preferences, out_options); + err = kim_preferences_get_options (preferences, &options); } + if (!err && !options) { + err = kim_options_allocate (&options); + } + + if (!err) { + *out_options = options; + options = NULL; /* caller takes ownership */ + } + + kim_options_free (&options); kim_preferences_free (&preferences); return check_error (err);