Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH Re: Crash if zsh exits with zftp module loaded



On Aug 8,  9:37pm, Bart Schaefer wrote:
}
} This only reproduces with a debugging malloc library that detects the
} double free:

So actually the problem is that the zsh/zftp module can't be loaded,
then unloaded, then loaded again without crashing either at reload or
somewhere else along the way.


diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index 30f5176..bd51512 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



Messages sorted by: Reverse Date, Date, Thread, Author