fixup! netutils/webserver : Fix problems from static analysis tool.
authorJin-Seong Kim <jseong82.kim@samsung.com>
Wed, 2 Aug 2017 01:41:01 +0000 (10:41 +0900)
committerEunBong Song <eunb.song@samsung.com>
Wed, 30 Aug 2017 04:15:49 +0000 (21:15 -0700)
Add return value check for pthread_attr_init.

Change-Id: Ie15633d16881934eeb2a1fab3775fb1f378d8330
Signed-off-by: Jin-Seong Kim <jseong82.kim@samsung.com>
Signed-off-by: EunBong Song <eunb.song@samsung.com>
apps/netutils/webserver/http.c

index c7c80a3..1124175 100644 (file)
@@ -275,7 +275,10 @@ int http_server_start(struct http_server_t *server)
                return HTTP_ERROR;
        }
 
-       pthread_attr_init(&attr);
+       if (pthread_attr_init(&attr) != 0) {
+               HTTP_LOGE("Error: Cannot initialize ptread attribute\n");
+               return HTTP_ERROR;
+       }
        pthread_attr_setschedpolicy(&attr, SCHED_RR);
        pthread_attr_setstacksize(&attr, HTTP_LISTENING_HANDLER_STACKSIZE);