Fix static analysis issue 27/190427/1
authorInkyun Kil <inkyun.kil@samsung.com>
Tue, 2 Oct 2018 00:56:20 +0000 (09:56 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Tue, 2 Oct 2018 00:56:20 +0000 (09:56 +0900)
- Return value

Change-Id: I5b27cf0649db241273ed6176871265b302bec66f
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
alarm-session-agent/agent.c

index 0e0f29b..19dda23 100755 (executable)
@@ -73,7 +73,12 @@ static int _sock_create(const char *path)
                return -1;
        }
 
-       chmod(sa.sun_path, 0666);
+       r = chmod(sa.sun_path, 0666);
+       if (r == -1) {
+               LOGE("Socket '%s': chmod %d", path, errno);
+               close(fd);
+               return -1;
+       }
 
        r = listen(fd, SOMAXCONN);
        if (r == -1) {