When kim_options_write_to_stream is given NULL options, create default options in...
authorJustin Anderson <jander@mit.edu>
Wed, 1 Oct 2008 14:01:03 +0000 (14:01 +0000)
committerJustin Anderson <jander@mit.edu>
Wed, 1 Oct 2008 14:01:03 +0000 (14:01 +0000)
ticket: 6055

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20792 dc483132-0cff-0310-8789-dd5450dbe970

src/kim/lib/kim_options.c

index 91ec406bb18d31fb0bc4808a0e6ad071b9355b96..c8ae31dd3f7f56d5dde57d99689fb442c289b5cb 100644 (file)
@@ -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);    
 }