From 64923f3a862dd65e9b5f6e9d651118b389e905be Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Mon, 16 May 2011 03:35:00 +0300 Subject: [PATCH] Revert "Fixed uninitialized vars in rooms created from templates" This reverts commit 9bf795905f4ac22d1add6166ac75f13cb1c0d7d4. ladish_room_create_interal() is suposed to allocate the struct and initialize the name and uuid members. The template member is supposed to be initialized by the caller functions, either ladish_room_create() or ladish_room_create_template(). The siblings member is initialized later, when the room is actually added to the appropriate list. The graph member is used by both room templates and room objects. This will be fixed in the following commit. All other ladish_room members are not valid for room template objects. --- daemon/room.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/daemon/room.c b/daemon/room.c index fd00dd65..bec936e9 100644 --- a/daemon/room.c +++ b/daemon/room.c @@ -58,12 +58,6 @@ 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); @@ -88,8 +82,6 @@ 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)) @@ -293,6 +285,12 @@ 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);