mirror of
https://github.com/iritmaximus/ttk91-compiler.git
synced 2026-10-12 19:13:40 +03:00
added a missing free, possible future bug fix
This commit is contained in:
@@ -191,5 +191,6 @@ int expr_free(struct expr *e)
|
|||||||
return SWITCH_NOT_MATCHED;
|
return SWITCH_NOT_MATCHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(e);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -22,9 +22,11 @@ void program_free(struct expr *program)
|
|||||||
{
|
{
|
||||||
struct expr *current = program;
|
struct expr *current = program;
|
||||||
|
|
||||||
|
// TODO: Error checking
|
||||||
while (current != NULL)
|
while (current != NULL)
|
||||||
{
|
{
|
||||||
|
struct expr *next = current->next;
|
||||||
expr_free(current);
|
expr_free(current);
|
||||||
current = current->next;
|
current = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user