diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2007-05-29 21:39:31 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-05-29 21:39:31 +0000 |
| commit | 5af264a64282689453f79ce943604d20110e4ffd (patch) | |
| tree | 1fdac98063eca4edc408aaca70507be7f1c7c2e4 /Src/module.c | |
| parent | 23488: tidy up module interface and documentation (diff) | |
| download | zsh-5af264a64282689453f79ce943604d20110e4ffd.tar zsh-5af264a64282689453f79ce943604d20110e4ffd.tar.gz zsh-5af264a64282689453f79ce943604d20110e4ffd.tar.bz2 zsh-5af264a64282689453f79ce943604d20110e4ffd.tar.lz zsh-5af264a64282689453f79ce943604d20110e4ffd.tar.xz zsh-5af264a64282689453f79ce943604d20110e4ffd.tar.zst zsh-5af264a64282689453f79ce943604d20110e4ffd.zip | |
unposted: clean up properly on failure to add autoloadable builtin
Diffstat (limited to 'Src/module.c')
| -rw-r--r-- | Src/module.c | 6 |
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 * |
