[WGID-373875] fix svace issue(UNCHECKED_FUNC_RES) 93/197893/2 accepted/tizen/unified/20190128.061208 submit/tizen/20190117.231022
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 17 Jan 2019 04:10:47 +0000 (13:10 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 17 Jan 2019 04:16:52 +0000 (13:16 +0900)
Change-Id: I3bab8e459c8c3ddb6dac5128ddb077ca136b661d

packaging/capi-network-http.spec
src/http_common.c

index 38cf333..da2530b 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-http
 Summary:       Http Framework
-Version:       0.0.36
+Version:       0.0.37
 Release:       0
 Group:         System/Network
 License:       Apache-2.0
index 34ace4d..66828ca 100644 (file)
@@ -48,7 +48,6 @@ bool _http_is_init(void)
 bool _http_check_permission(http_privilege_e _privilege)
 {
        FILE *fd;
-
        int ret;
        char smack_label[SMACK_LABEL_LEN + 1] = {0, };
        char uid[10];
@@ -70,10 +69,10 @@ bool _http_check_permission(http_privilege_e _privilege)
                ERR("Failed to open /proc/self/attr/current\n");
                return false;
        }
-       ret = fread(smack_label, SMACK_LABEL_LEN, 1, fd);
 
-       if (ferror(fd)) {
-               ERR("Failed to read /proc/self/attr/current\n");
+       ret = fread(smack_label, SMACK_LABEL_LEN, 1, fd);
+       if (ret < 0) {
+               ERR("Failed[%d] to read /proc/self/attr/current\n", ferror(fd));
                fclose(fd);
                return false;
        }