summaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-09-21 20:17:00 +0200
committerJo-Philipp Wich <jo@mein.io>2021-09-21 20:25:46 +0200
commit631f00df1189550cca923c3d08885e6a7208d542 (patch)
tree5d5b70dd7bb953c3c26f56b7a1d9dfcfa104b59d /main.c
parente55188bb8bba50e7518a7d95c680cc46607eb24f (diff)
main: fix leaking module name when processing -m flag
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index dd992ac..834976d 100644
--- a/main.c
+++ b/main.c
@@ -331,11 +331,14 @@ main(int argc, char **argv)
break;
case 'm':
- o = uc_vm_invoke(&vm, "require", 1, ucv_string_new(optarg));
+ p = ucv_string_new(optarg);
+ o = uc_vm_invoke(&vm, "require", 1, p);
if (o)
register_variable(uc_vm_scope_get(&vm), optarg, o);
+ ucv_put(p);
+
break;
case 't':