summary refs log tree commit diff
path: root/Src/Modules/db_gdbm.c
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-07-31 22:15:58 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-07-31 22:15:58 +0900
commitbaedd62f0d601bf03d99b2366a8ace42268e88ed (patch)
tree82add95fcfcf764c535b2b3ee126eb012ba5b648 /Src/Modules/db_gdbm.c
parente6f2d776d3ce582533fc6177082270872fcf67a3 (diff)
downloadzsh-baedd62f0d601bf03d99b2366a8ace42268e88ed.tar.gz
zsh-baedd62f0d601bf03d99b2366a8ace42268e88ed.tar.xz
zsh-baedd62f0d601bf03d99b2366a8ace42268e88ed.zip
43219 (except term{cap,info}.c): fix several memory leaks
Diffstat (limited to 'Src/Modules/db_gdbm.c')
-rw-r--r--Src/Modules/db_gdbm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/Modules/db_gdbm.c b/Src/Modules/db_gdbm.c
index 5f776f407..ed702b912 100644
--- a/Src/Modules/db_gdbm.c
+++ b/Src/Modules/db_gdbm.c
@@ -359,7 +359,7 @@ gdbmsetfn(Param pm, char *val)
     }
 
     if (val) {
-        pm->u.str = ztrdup(val);
+        pm->u.str = val;
         pm->node.flags |= PM_UPTODATE;
     }
 
@@ -732,6 +732,9 @@ static int remove_tied_name( const char *name ) {
         p++;
     }
 
+    if (*p)
+	zsfree(*p);
+
     /* Copy x+1 to x */
     while (*p) {
         *p=*(p+1);