about summary refs log tree commit diff
diff options
context:
space:
mode:
-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