Change some free to g-free because it was alloced by g_strdup/g_strdup_printf 58/102058/2 accepted/tizen/common/20161207.184530 accepted/tizen/ivi/20161208.012219 accepted/tizen/mobile/20161208.011833 accepted/tizen/tv/20161208.012023 submit/tizen/20161207.075356
authorSeokHoon Lee <andy.shlee@samsung.com>
Mon, 5 Dec 2016 01:21:33 +0000 (10:21 +0900)
committerSeokHoon Lee <andy.shlee@samsung.com>
Mon, 5 Dec 2016 01:41:14 +0000 (10:41 +0900)
[Version] 0.1.59
[Profile] Common
[Issue Type] Code refactoring
[Dependency module] N/A
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-3.0-mobile_20161130.2]

Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: I5c8f3695f998e83fcbf378a2191ab5bfcc0a27b4

include/scmirroring_private.h [changed mode: 0755->0644]
miracast_server/miracast_server_impl.c
packaging/capi-media-screen-mirroring.spec
src/scmirroring_src.c

old mode 100755 (executable)
new mode 100644 (file)
index 387bf4a..ba76c2e
@@ -88,6 +88,7 @@ extern "C" {
        } while (0)
 
 #define SCMIRRORING_SAFE_FREE(src)      { if (src) {free(src); src = NULL; } }
+#define SCMIRRORING_SAFE_G_FREE(src)      { if (src) {g_free(src); src = NULL; } }
 #define STRING_VALID(str)              ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
 
 #define SCMIRRORING_STATE_CMD_START                    "START"
index 4dce052040c883383aec016a6c5f66aac62260bd..31b5c9c8b9e355bd6fa2b211741877196635abdb 100644 (file)
@@ -477,7 +477,7 @@ gint miracast_server_gst_init()
 
        /* release */
        for (i = 0; i < *argc; i++)
-               SCMIRRORING_SAFE_FREE(argv[i]);
+               SCMIRRORING_SAFE_G_FREE(argv[i]);
 
        SCMIRRORING_SAFE_FREE(argv);
        SCMIRRORING_SAFE_FREE(argc);
@@ -486,7 +486,7 @@ gint miracast_server_gst_init()
 
 ERROR:
        for (i = 0; i < *argc; i++)
-               SCMIRRORING_SAFE_FREE(argv[i]);
+               SCMIRRORING_SAFE_G_FREE(argv[i]);
 
        SCMIRRORING_SAFE_FREE(argv);
        SCMIRRORING_SAFE_FREE(argc);
index 59b5dd5257b6faf312f155986aef9d384919e5bd..bedea9e8c375bc573efbe4bbbec37fe7b754db43 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-screen-mirroring
 Summary:    A screen mirroring library in Tizen C API
-Version:    0.1.58
+Version:    0.1.59
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index c28dad082a22584b85db97c1d7519a639250d0b1..887cb50f20771259f14bc30d95df5a658fe0f025 100644 (file)
@@ -53,7 +53,7 @@ static gboolean __scmirroring_src_callback_call(gpointer data)
                g_io_channel_shutdown(scmirroring->channel, FALSE, NULL);
                g_io_channel_unref(scmirroring->channel);
 
-               SCMIRRORING_SAFE_FREE(scmirroring->sock_path);
+               SCMIRRORING_SAFE_G_FREE(scmirroring->sock_path);
                SCMIRRORING_SAFE_FREE(scmirroring);
        }
 
@@ -80,7 +80,7 @@ static int __scmirroring_src_send_cmd_to_server(scmirroring_src_s *scmirroring,
                scmirroring_debug("Sent message [%s] successfully", _cmd);
        }
 
-       SCMIRRORING_SAFE_FREE(_cmd);
+       SCMIRRORING_SAFE_G_FREE(_cmd);
 
        return ret;
 }
@@ -294,12 +294,12 @@ static int __scmirroring_src_send_set_cm(scmirroring_src_h scmirroring)
        cmd = g_strdup_printf("SET CM %d", _scmirroring->connect_mode);
        ret = __scmirroring_src_send_cmd_to_server(_scmirroring, cmd);
        if (ret != SCMIRRORING_ERROR_NONE) {
-               SCMIRRORING_SAFE_FREE(cmd);
+               SCMIRRORING_SAFE_G_FREE(cmd);
                scmirroring_error("Failed to be ready [%d]", ret);
                return SCMIRRORING_ERROR_INVALID_OPERATION;
        }
 
-       SCMIRRORING_SAFE_FREE(cmd);
+       SCMIRRORING_SAFE_G_FREE(cmd);
 
        return ret;
 }
@@ -314,12 +314,12 @@ static int __scmirroring_src_send_set_ip(scmirroring_src_h scmirroring)
        cmd = g_strdup_printf("SET IP %s:%s", _scmirroring->ip, _scmirroring->port);
        ret = __scmirroring_src_send_cmd_to_server(_scmirroring, cmd);
        if (ret != SCMIRRORING_ERROR_NONE) {
-               SCMIRRORING_SAFE_FREE(cmd);
+               SCMIRRORING_SAFE_G_FREE(cmd);
                scmirroring_error("Failed to be ready [%d]", ret);
                return SCMIRRORING_ERROR_INVALID_OPERATION;
        }
 
-       SCMIRRORING_SAFE_FREE(cmd);
+       SCMIRRORING_SAFE_G_FREE(cmd);
 
        return ret;
 }
@@ -334,12 +334,12 @@ static int __scmirroring_src_send_set_reso(scmirroring_src_h scmirroring)
        cmd = g_strdup_printf("SET RESO %d", _scmirroring->resolution);
        ret = __scmirroring_src_send_cmd_to_server(_scmirroring, cmd);
        if (ret != SCMIRRORING_ERROR_NONE) {
-               SCMIRRORING_SAFE_FREE(cmd);
+               SCMIRRORING_SAFE_G_FREE(cmd);
                scmirroring_error("Failed to be ready [%d]", ret);
                return SCMIRRORING_ERROR_INVALID_OPERATION;
        }
 
-       SCMIRRORING_SAFE_FREE(cmd);
+       SCMIRRORING_SAFE_G_FREE(cmd);
 
        return ret;
 }
@@ -354,12 +354,12 @@ static int __scmirroring_src_send_set_multisink(scmirroring_src_h scmirroring)
        cmd = g_strdup_printf("SET MULTISINK %d", _scmirroring->resolution);
        ret = __scmirroring_src_send_cmd_to_server(_scmirroring, cmd);
        if (ret != SCMIRRORING_ERROR_NONE) {
-               SCMIRRORING_SAFE_FREE(cmd);
+               SCMIRRORING_SAFE_G_FREE(cmd);
                scmirroring_error("Failed to be ready [%d]", ret);
                return SCMIRRORING_ERROR_INVALID_OPERATION;
        }
 
-       SCMIRRORING_SAFE_FREE(cmd);
+       SCMIRRORING_SAFE_G_FREE(cmd);
 
        return ret;
 }
@@ -370,17 +370,17 @@ static int __scmirroring_src_send_switch_transport(scmirroring_src_h scmirroring
        char *cmd = NULL;
        int ret = SCMIRRORING_ERROR_NONE;
        scmirroring_src_s *_scmirroring = (scmirroring_src_s *)scmirroring;
-       const char *tr = _scmirroring->av_transport == SCMIRRORING_AV_TRANSPORT_UDP ? "UDP": "TCP";
+       const char *tr = _scmirroring->av_transport == SCMIRRORING_AV_TRANSPORT_UDP ? "UDP" : "TCP";
 
        cmd = g_strdup_printf("SWITCH %s", tr);
        ret = __scmirroring_src_send_cmd_to_server(_scmirroring, cmd);
        if (ret != SCMIRRORING_ERROR_NONE) {
-               SCMIRRORING_SAFE_FREE(cmd);
+               SCMIRRORING_SAFE_G_FREE(cmd);
                scmirroring_error("Failed to be ready [%d]", ret);
                return SCMIRRORING_ERROR_INVALID_OPERATION;
        }
 
-       SCMIRRORING_SAFE_FREE(cmd);
+       SCMIRRORING_SAFE_G_FREE(cmd);
 
        return ret;
 }
@@ -734,7 +734,7 @@ int scmirroring_src_disconnect(scmirroring_src_h scmirroring)
                _scmirroring->sock = -1;
        }
 
-       SCMIRRORING_SAFE_FREE(_scmirroring->sock_path);
+       SCMIRRORING_SAFE_G_FREE(_scmirroring->sock_path);
        _scmirroring->connected = NOT_CONNECTED_TO_SERVER;
 
        scmirroring_debug_fleave();
@@ -803,7 +803,7 @@ int scmirroring_src_resume(scmirroring_src_h scmirroring)
 }
 
 int scmirroring_src_AV_transport_switch(scmirroring_src_h scmirroring,
-    scmirroring_av_transport_e transport)
+               scmirroring_av_transport_e transport)
 {
        CHECK_FEATURE_SUPPORTED(WIFIDIRECT_DISPLAY_FEATURE);
 
@@ -815,7 +815,7 @@ int scmirroring_src_AV_transport_switch(scmirroring_src_h scmirroring,
        scmirroring_retvm_if(_scmirroring == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "Handle is NULL");
 
        if (transport < SCMIRRORING_AV_TRANSPORT_UDP || transport > SCMIRRORING_AV_TRANSPORT_TCP) {
-               scmirroring_error ("Invalid transport");
+               scmirroring_error("Invalid transport");
                return SCMIRRORING_ERROR_INVALID_PARAMETER;
        }