summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2012-12-05 18:47:07 +0000
committerKristian Høgsberg <krh@bitplanet.net>2012-12-11 23:47:20 -0500
commit8104ec5dd55071ad30669592f91fe2efc134447d (patch)
tree86451c11b865eca59607709a3c3194a58ecf8652
parentb27094f1b2d57f66e9053b764e3c74c57a28ee62 (diff)
downloadweston-8104ec5dd55071ad30669592f91fe2efc134447d.tar.gz
xwayland: Close fd opened for lockfile on error path
-rw-r--r--src/xwayland/launcher.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/xwayland/launcher.c b/src/xwayland/launcher.c
index 00f064eb..9155c09f 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;
}