summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/module.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/module.c b/Src/module.c
index c837193e8..05a0d402a 100644
--- a/Src/module.c
+++ b/Src/module.c
@@ -202,7 +202,11 @@ add_autobin(char *nam, char *module)
     Builtin bn = zshcalloc(sizeof(*bn));
     bn->node.nam = ztrdup(nam);
     bn->optstr = ztrdup(module);
-    return addbuiltin(bn);
+    if (addbuiltin(bn)) {
+	builtintab->freenode(&bn->node);
+	return 1;
+    }
+    return 0;
 }
 
 /* Remove the builtin added previously by addbuiltin().  Returns *