From 9bf795905f4ac22d1add6166ac75f13cb1c0d7d4 Mon Sep 17 00:00:00 2001 From: "Dan A. Muresan" Date: Sat, 14 May 2011 13:06:16 +0300 Subject: [PATCH] Fixed uninitialized vars in rooms created from templates --- daemon/room.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/daemon/room.c b/daemon/room.c index d28b9021..8c3e17e9 100644 --- a/daemon/room.c +++ b/daemon/room.c @@ -58,6 +58,12 @@ struct ladish_room * ladish_room_create_internal(const uuid_t uuid_ptr, const ch goto fail; } + room_ptr->project_name = NULL; + room_ptr->project_dir = NULL; + room_ptr->project_description = NULL; + room_ptr->project_notes = NULL; + room_ptr->project_state = ROOM_PROJECT_STATE_UNLOADED; + if (uuid_ptr != NULL) { uuid_copy(room_ptr->uuid, uuid_ptr); @@ -82,6 +88,8 @@ struct ladish_room * ladish_room_create_internal(const uuid_t uuid_ptr, const ch log_error("strdup() failed for room name"); goto free_name; } + } else { + room_ptr->object_path = NULL; } if (!ladish_graph_create(&room_ptr->graph, object_path)) @@ -285,12 +293,6 @@ ladish_room_create( room_ptr->started = false; room_ptr->version = 1; - room_ptr->project_name = NULL; - room_ptr->project_dir = NULL; - room_ptr->project_description = NULL; - room_ptr->project_notes = NULL; - room_ptr->project_state = ROOM_PROJECT_STATE_UNLOADED; - if (template != NULL) { ladish_room_get_uuid(template, room_ptr->template_uuid);