Soft'N'Design Software
/
projects
/
calc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eeb2d6a
)
fix a memory leak
author
Laurent Mazet
<mazet@softndesign.org>
Tue, 14 Feb 2023 22:25:12 +0000
(23:25 +0100)
committer
Laurent Mazet
<mazet@softndesign.org>
Tue, 14 Feb 2023 22:25:12 +0000
(23:25 +0100)
workspace.c
patch
|
blob
|
blame
|
history
diff --git
a/workspace.c
b/workspace.c
index 26bbe8abcbcd70fb2f30d79a2e1f9d06249fbc85..9fc4d83d522795b0bfab4c1e4043527694dd1e5c 100644
(file)
--- a/
workspace.c
+++ b/
workspace.c
@@
-23,8
+23,17
@@
workspace_t *alloc_ws ()
workspace_t *backup_ws (workspace_t *ws)
{
ws->answer = answer;
+ if (ws->argument) {
+ free_tab (ws->argument);
+ }
ws->argument = copy_tab (argument);
+ if (ws->stack) {
+ free_tab (ws->stack);
+ }
ws->stack = copy_tab (stack);
+ if (ws->storage) {
+ free_tab (ws->storage);
+ }
ws->storage = copy_tab (storage);
return ws;
}