From d9929a057051f3287ef2a60102ba99fb6d54f68b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 24 Feb 2014 17:29:17 +0100 Subject: [PATCH] Unlink socket when forkpty fails --- abduco.c | 1 + 1 file changed, 1 insertion(+) diff --git a/abduco.c b/abduco.c index 4d35d9b..ae0c4ae 100644 --- a/abduco.c +++ b/abduco.c @@ -282,6 +282,7 @@ static bool create_session(const char *name, char * const argv[]) { wait(&status); /* wait for first fork */ if ((status = read_all(pipefds[0], errormsg, sizeof(errormsg))) > 0) { write_all(STDERR_FILENO, errormsg, status); + unlink(sockaddr.sun_path); exit(EXIT_FAILURE); } close(pipefds[0]);