Change memory allocation way for sending message text. 90/205790/4 accepted/tizen/unified/20190515.085019 submit/tizen/20190510.035358 submit/tizen/20190515.052218
authorHyunsoo Park <hance.park@samsung.com>
Thu, 9 May 2019 07:23:27 +0000 (16:23 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Fri, 10 May 2019 02:12:54 +0000 (11:12 +0900)
g_malloc requires setting string size as second parameter.
So for making it flex, i changed it to g_strdup_printf.

Change-Id: Ib0117da8d0a1d49122a77e62800bd87e47e11a73
Signed-off-by: Hyunsoo Park <hance.park@samsung.com>
miracast_server/miracast_server_impl.c
packaging/capi-media-screen-mirroring.spec

index 95efc13a62e61567b50f79eb06f3817448ba92b7..e49b61eae0e7d99c6c7cc5bb2033024e03f13015 100644 (file)
@@ -498,10 +498,9 @@ __client_closed(GstRTSPClient *client, gpointer user_data)
        scmirroring_debug("client %p: connection closed", client);
 
        /* Sends coupled sink address to scmirroring_src */
-       if(server_obj->coupling_mode == 1){
-               gchar * msg = g_malloc(sizeof(char *) * 50);
-               g_sprintf(msg, "MESSAGE:COUPLED_SINK_ADDRESS:%s", gst_rtsp_connection_get_ip(connection));
-               klass->send_response(server_obj,msg);
+       if (server_obj->coupling_mode == TRUE) {
+               gchar *msg = g_strdup_printf("MESSAGE:COUPLED_SINK_ADDRESS:%s", gst_rtsp_connection_get_ip(connection));
+               klass->send_response(server_obj, msg);
                g_free(msg);
                usleep(250000);
        }
index b0399f736c4664721e6b8fec6a73f2c1d704b8dd..4ea8f5135d36de6330cc6aaad6b803b9ddef4786 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-screen-mirroring
 Summary:    A screen mirroring library in Tizen C API
-Version:    0.2.0
+Version:    0.2.1
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0