Fix bugs detected by static anlayzer 72/198372/2 accepted/tizen/unified/20190213.071821 submit/tizen/20190211.090225
authorYu <jiung.yu@samsung.com>
Thu, 24 Jan 2019 07:31:13 +0000 (16:31 +0900)
committerYu <jiung.yu@samsung.com>
Fri, 1 Feb 2019 07:25:39 +0000 (16:25 +0900)
Change-Id: I6ea5d2b20ecde3995e9fe3d91d37cb3a86d01626
Signed-off-by: Yu Jiung <jiung.yu@samsung.com>
src/inm-net-access.c
src/inm-trace-route.c
src/inm-util.c

index 3d7ce47a514147b05dc83e0f26728850826bc9bd..59a960c959ce7bf159aadedb65c469fb93f689b4 100644 (file)
@@ -53,7 +53,7 @@
 
 #define BUF_SIZE 2048
 #define INM_INTERNET_CHECK_TIMEOUT     3
-#define HTTP_STATUS_CODE_OK    "HTTP/1.1 200"
+#define HTTP_STATUS_CODE_OK    "HTTP/1.1 200"
 #define HTTP_STATUS_CODE_FOUND "HTTP/1.1 302"
 
 #define HTTP_STR_AUTH_ACTION   "auth action"
index a95ad1da1bd280ab99d35efd91f4e82b6acb320d..195597f5cbc0ec4c9dc3f96df4365a6e69dedb72 100644 (file)
@@ -61,7 +61,7 @@
                if (!is_initialized) {\
                        __INM_FUNC_EXIT__;\
                        return INM_TRACE_ROUTE_ERROR_NOT_INITIALIZED;\
-               }\
+               } \
        } while (0)
 
 #define RET_ERR_IF_INVALID_PARAM(param)\
@@ -69,7 +69,7 @@
                if (!(param)) {\
                        __INM_FUNC_EXIT__;\
                        return INM_TRACE_ROUTE_ERROR_INVALID_PARAM;\
-               }\
+               } \
        } while (0)
 
 #define RET_MINUS_WITH_MSG_IF_NULL(param, msg)\
@@ -78,7 +78,7 @@
                        INM_LOGE(msg);\
                        __INM_FUNC_EXIT__;\
                        return -1;\
-               }\
+               } \
        } while (0)
 
 #define RET_MINUS_IF_NOT_ZERO(param)\
@@ -86,7 +86,7 @@
                if ((param) != 0) {\
                        __INM_FUNC_EXIT__;\
                        return -1;\
-               }\
+               } \
        } while (0)
 
 /* Information associated with a specific socket */
@@ -619,6 +619,7 @@ static int __create_trace_route_data(gchar *target, gint port)
 
        res = __allocate_neccessary(target, &p_trace_route, &p_target_str);
        if (res != 0) {
+               g_free(p_target_str);
                __clear_trace_route_data(p_trace_route);
                return -1;
        }
@@ -628,6 +629,7 @@ static int __create_trace_route_data(gchar *target, gint port)
        port = port ? port : DEFAULT_TRACE_ROUTE_PORT;
        res = __resolve_target(target, port, &p_addr_info);
        if (res != 0) {
+               freeaddrinfo(p_addr_info);
                __clear_trace_route_data(p_trace_route);
                return -1;
        }
index 4f54ab62ef31b76e8ac2cf205b758c973e50be24..b708b50ada209148144fd744c881bac70dbfd588 100644 (file)
@@ -82,7 +82,7 @@
                        INM_LOGW("socket Failed");\
                        __INM_FUNC_EXIT__;\
                        return;\
-               }\
+               } \
        } while (0)
 
 #define LOG_FILE_PATH   "/opt/usr/data/network/inm-manager.log"