Fix svace issues (WGID-207858, 208122, 208137, 208138) 28/128028/3 accepted/tizen/unified/20170504.114207 submit/tizen/20170504.080025
authorchleun.moon <chleun.moon@samsung.com>
Thu, 4 May 2017 06:23:33 +0000 (15:23 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Thu, 4 May 2017 06:37:58 +0000 (15:37 +0900)
Change-Id: I31373fbb6ad79517e63f4023c1f4bac2f63424e5
Signed-off-by: cheoleun <chleun.moon@samsung.com>
src/inet.c
vpn/plugins/ipsec.c

index 45408ce..c65ebb3 100755 (executable)
@@ -1468,6 +1468,9 @@ static int ndisc_send_unspec(int type, int oif, const struct in6_addr *dest,
        char cbuf[CMSG_SPACE(sizeof(*pinfo))];
        struct iovec iov[2];
        int fd, datalen, ret, iovlen = 1;
+#if defined TIZEN_EXT
+       char ebuf[256];
+#endif
 
        DBG("");
 
@@ -1547,7 +1550,7 @@ static int ndisc_send_unspec(int type, int oif, const struct in6_addr *dest,
 
        ret = sendmsg(fd, &msgh, 0);
 #if defined TIZEN_EXT
-       DBG("sendmsg errno: %d/%s", errno, strerror(errno));
+       DBG("sendmsg errno: %d/%s", errno, strerror_r(errno, ebuf, sizeof(ebuf)));
 #endif
 
        close(fd);
index e4bbf2b..cd8b625 100644 (file)
@@ -722,7 +722,7 @@ static char *load_file_from_path(const char *path)
        size_t  file_size = 0;
        char *file_buff = NULL;
 
-       if (path) {
+       if (!path) {
                connman_error("File path is NULL\n");
                return NULL;
        }
@@ -841,6 +841,7 @@ static int ipsec_load_cert(struct vpn_provider *provider)
        DBG("CertType: %s, CertFalg: %s,CertData: %s", type, flag, data);
        if (!type || ! flag || !data) {
                connman_error("invalid certification information");
+               g_free(data);
                return -EINVAL;
        }
 
@@ -971,6 +972,9 @@ done:
        if(err != 0 && cb)
                cb(provider, data->user_data, -err);
 
+       if (data)
+               g_free(data);
+
        return;
 }