about summary refs log tree commit diff stats
path: root/src/lua.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-12-16 04:02:37 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-12-16 04:02:37 -0800
commit76ed8d30f411d980d25086d2bbfe048c2816180d (patch)
tree4fe93db6b5794c6dc9f2cd6be12079834120ec38 /src/lua.c
parent68e008526a8e5a461f42beca3518b39deccdba27 (diff)
downloadteliva-76ed8d30f411d980d25086d2bbfe048c2816180d.tar.gz
Revert "stop leaking on the Lua stack"
This reverts commit 7c1b9d0b91295323b5ed5ec3e09b46566288bc75.

The 'big hammer' isn't good enough. The recent changes view seems to
need state on the stack across invocations of the editor.
Diffstat (limited to 'src/lua.c')
-rw-r--r--src/lua.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua.c b/src/lua.c
index 834e547..ac6e249 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -901,10 +901,10 @@ int restore_editor_view (lua_State *L) {
     status = load_editor_buffer_to_current_definition_in_image(L);
     if (status == 0 || lua_isnil(L, -1))
       break;
-    Previous_error = strdup(lua_tostring(L, -1));  /* memory leak */
+    Previous_error = lua_tostring(L, -1);
     if (Previous_error == NULL) Previous_error = "(error object is not a string)";
-    lua_pop(L, 1);
     back_to_big_picture = resumeEdit(L);
+    lua_pop(L, 1);
   }
   return back_to_big_picture;
 }