[CID-32919, 33501] Unchecked return value 75/156675/1 accepted/tizen/unified/20171026.074637 submit/tizen/20171025.003923
authorchleun.moon <chleun.moon@samsung.com>
Thu, 19 Oct 2017 10:38:09 +0000 (19:38 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Thu, 19 Oct 2017 10:38:13 +0000 (19:38 +0900)
Change-Id: I561f537c292f24af2e9956a7694e3868ee0ccd32
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
vpn/plugins/ipsec.c
vpn/plugins/vici-client.c

index 617830c..cbc6cb6 100644 (file)
@@ -802,7 +802,12 @@ static char *load_file_from_path(const char *path)
                return NULL;
        }
 
-       fstat(fd, &st);
+       if (fstat(fd, &st) != 0) {
+               connman_error("fstat failed");
+               fclose(fp);
+               return NULL;
+       }
+
        file_size = st.st_size;
        file_buff = g_try_malloc0(sizeof(char)*st.st_size);
        if (file_buff == NULL) {
index 5fcc3c5..67e365a 100644 (file)
@@ -286,7 +286,12 @@ static char *load_cert_from_path(const char *path)
                return NULL;
        }
 
-       fstat(fd, &st);
+       if (fstat(fd, &st) != 0) {
+               connman_error("fstat failed");
+               fclose(fp);
+               return NULL;
+       }
+
        file_size = st.st_size;
        file_buff = g_try_malloc0(sizeof(char)*st.st_size);
        if (file_buff == NULL) {