Index: ssh-agent.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/ssh-agent.c,v
retrieving revision 1.120
diff -u -r1.120 ssh-agent.c
--- ssh-agent.c	11 Aug 2004 21:43:05 -0000	1.120
+++ ssh-agent.c	4 Oct 2004 06:34:59 -0000
@@ -1106,6 +1106,7 @@
 	sock = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (sock < 0) {
 		perror("socket");
+		*socket_name = '\0'; /* Don't unlink any existing file */
 		cleanup_exit(1);
 	}
 	memset(&sunaddr, 0, sizeof(sunaddr));
@@ -1113,6 +1114,7 @@
 	strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path));
 	if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) {
 		perror("bind");
+		*socket_name = '\0'; /* Don't unlink any existing file */
 		cleanup_exit(1);
 	}
 	if (listen(sock, SSH_LISTEN_BACKLOG) < 0) {
