From bc306cc419e139a87a2a1d08fc4ceb1cdbd2ea2a Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Wed, 1 Oct 2008 14:01:03 +0000 Subject: [PATCH] When kim_options_write_to_stream is given NULL options, create default options in its place instead of erroring out ticket: 6055 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20792 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kim/lib/kim_options.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/kim/lib/kim_options.c b/src/kim/lib/kim_options.c index 91ec406bb..c8ae31dd3 100644 --- a/src/kim/lib/kim_options.c +++ b/src/kim/lib/kim_options.c @@ -522,10 +522,16 @@ kim_error kim_options_write_to_stream (kim_options in_options, k5_ipc_stream io_stream) { kim_error err = KIM_NO_ERROR; - - if (!err && !in_options) { err = check_error (KIM_NULL_PARAMETER_ERR); } + kim_options options = NULL; + if (!err && !io_stream ) { err = check_error (KIM_NULL_PARAMETER_ERR); } + if (!err && !in_options) { + err = kim_options_create(&options); + } else { + err = kim_options_copy(&options, in_options); + } + if (!err) { err = k5_ipc_stream_write_int64 (io_stream, in_options->start_time); } @@ -561,7 +567,7 @@ kim_error kim_options_write_to_stream (kim_options in_options, err = k5_ipc_stream_write_string (io_stream, service_name); } - + kim_options_free(&options); return check_error (err); } -- 2.26.2