From ef94085ff1ad05c1604ad65fa9777976b8d4cdd4 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 5 Dec 2012 18:47:07 +0000 Subject: [PATCH] xwayland: Close fd opened for lockfile on error path --- src/xwayland/launcher.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xwayland/launcher.c b/src/xwayland/launcher.c index 59154a3e..ddd9640c 100644 --- a/src/xwayland/launcher.c +++ b/src/xwayland/launcher.c @@ -247,6 +247,9 @@ create_lockfile(int display, char *lockfile, size_t lsize) if (fd < 0 || read(fd, pid, 11) != 11) { weston_log("can't read lock file %s: %s\n", lockfile, strerror(errno)); + if (fd >= 0) + close (fd); + errno = EEXIST; return -1; }