From ba25bd7be1ea9fbf1862dd662b80ddd7753ed4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 10 Apr 2012 01:31:09 -0400 Subject: [PATCH] weston-launcher: Fix uninitialized variable warning --- src/launcher-util.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/launcher-util.c b/src/launcher-util.c index 519cd9df..ad03c1db 100644 --- a/src/launcher-util.c +++ b/src/launcher-util.c @@ -68,6 +68,7 @@ weston_launcher_open(struct weston_compositor *compositor, do { len = send(sock, message, n, 0); } while (len < 0 && errno == EINTR); + free(message); memset(&msg, 0, sizeof msg); iov.iov_base = &ret; @@ -83,14 +84,14 @@ weston_launcher_open(struct weston_compositor *compositor, if (len != sizeof ret || ret < 0) - goto out; + return -1; cmsg = CMSG_FIRSTHDR(&msg); if (!cmsg || cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) { fprintf(stderr, "invalid control message\n"); - goto out; + return -1; } data = (union cmsg_data *) CMSG_DATA(cmsg); @@ -99,9 +100,7 @@ weston_launcher_open(struct weston_compositor *compositor, return -1; } -out: - free(message); - return ret < 0 ? ret : data->fd; + return data->fd; } int