ladishd: Fix use of uninitialized memory

room template objects don't use project related members
This commit is contained in:
Nedko Arnaudov 2011-05-16 05:56:01 +03:00
parent 18c88a94c3
commit deab81c2ef
1 changed files with 7 additions and 7 deletions

View File

@ -377,6 +377,8 @@ release_index:
#define room_ptr ((struct ladish_room *)room_handle)
void ladish_room_destroy(ladish_room_handle room_handle)
{
if (!room_ptr->template)
{
/* project has either both name and dir no none of them */
ASSERT((room_ptr->project_dir == NULL && room_ptr->project_name == NULL) || (room_ptr->project_dir != NULL && room_ptr->project_name != NULL));
@ -385,8 +387,6 @@ void ladish_room_destroy(ladish_room_handle room_handle)
free(room_ptr->project_description);
free(room_ptr->project_notes);
if (!room_ptr->template)
{
ASSERT(!room_ptr->started); /* attempt to destroy not stopped room */
/* ladish_graph_dump(graph); */