Fixed uninitialized vars in rooms created from templates

This commit is contained in:
Dan A. Muresan 2011-05-14 13:06:16 +03:00
parent 0b568aeb99
commit 9bf795905f
1 changed files with 8 additions and 6 deletions

View File

@ -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);