about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-08-09 16:10:47 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-08-09 16:13:52 -0700
commita88415cbf71a02cfe26647d1775b00044df262d1 (patch)
treea76e2c35c86434da6597e1d230bfc8e49861e2a6
parent9958684574bf8b0ecec6983cca57f3fa3dd7cd63 (diff)
downloadzsh-a88415cbf71a02cfe26647d1775b00044df262d1.tar.gz
zsh-a88415cbf71a02cfe26647d1775b00044df262d1.tar.xz
zsh-a88415cbf71a02cfe26647d1775b00044df262d1.zip
36026: zero freed pointers in zftp cleanup_() in case the module is re-loaded after unloading
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/zftp.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index eada38b91..1456675bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,9 @@
 
 2015-08-09  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* 36026: Src/Modules/zftp.c: zero freed pointers in cleanup_()
+	in case the module is re-loaded after unloading.
+
 	* 36022: Src/loop.c: fix bug that some loop constructs could
 	not be interrupted if all they did was variable assignments or
 	math expressions
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index 30f517658..bd51512f9 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -3149,9 +3149,11 @@ zftp_cleanup(void)
 	zfclose(zfsess != cursess);
     }
     zsfree(lastmsg);
+    lastmsg = NULL;
     zfunsetparam("ZFTP_SESSION");
     freelinklist(zfsessions, (FreeFunc) freesession);
     zfree(zfstatusp, sizeof(int)*zfsesscnt);
+    zfstatusp = NULL;
 }
 
 static int