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

PATCH: memory leak in bin_ztcp



CID 85.

remotename is only used in the printf which follows, so there's no need to
duplicate the string.

Index: Src/Modules/tcp.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/tcp.c,v
retrieving revision 1.47
diff -u -r1.47 tcp.c
--- Src/Modules/tcp.c	12 Jul 2007 03:09:13 -0000	1.47
+++ Src/Modules/tcp.c	1 Nov 2008 18:13:42 -0000
@@ -570,7 +570,7 @@
 		    if (ztpeer)
 			remotename = ztpeer->h_name;
 		    else
-			remotename = ztrdup(inet_ntoa(sess->peer.in.sin_addr));
+			remotename = inet_ntoa(sess->peer.in.sin_addr);
 		    if (OPT_ISSET(ops,'L')) {
 			int schar;
 			if (sess->flags & ZTCP_ZFTP)



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