fix coverity NEGATIVE_RETURNS issue 49/214849/2 submit/tizen/20190927.074752
authorwansu.yoo <wansu.yoo@samsung.com>
Fri, 27 Sep 2019 06:28:42 +0000 (15:28 +0900)
committerwansu.yoo <wansu.yoo@samsung.com>
Fri, 27 Sep 2019 07:11:54 +0000 (16:11 +0900)
Change-Id: Ifb1c61329d4270d485d8e56fbc5ae0db9ed364d3
Signed-off-by: wansu.yoo <wansu.yoo@samsung.com>
libedge-orchestration/sample/main_chrome.c

index 6b63fc3..52b37b0 100644 (file)
@@ -16,6 +16,7 @@
  *******************************************************************************/
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <orchestration_client.h>
 
 #include <unistd.h>
@@ -36,6 +37,10 @@ int get_ip_addr(char ipstr[40]) {
     char *addr = {0, };
 
     fd = socket(AF_INET, SOCK_DGRAM, 0);
+    if (fd == -1) {
+        printf("socket failed");
+        exit(EXIT_FAILURE);
+    }
     ifr.ifr_addr.sa_family = AF_INET;
 
     /* I want IP address attached to "wlan0" */