Coverity fix 49/154449/2
authorINSUN PYO <insun.pyo@samsung.com>
Tue, 10 Oct 2017 08:26:54 +0000 (17:26 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Tue, 10 Oct 2017 08:28:10 +0000 (17:28 +0900)
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Ie31a0b06a8afb94c46ca59fdb75b0beef7241176

src/logger/logger.c

index dd43be3..0ae3894 100644 (file)
@@ -1711,8 +1711,10 @@ static int socket_initialize(struct sock_data *sock, struct log_buffer *buffer,
                return sock_fd;
 
        int r = change_owners(data->path, data->owner, data->group);
-       if (r < 0)
+       if (r < 0) {
+               close(sock_fd);
                return r;
+       }
 
        init_fd_entity(&sock->fd_entity, dispatch_event_sock, sock);
        sock->service_socket = service_socket;