sdp: copy and free the server ip address

Copy and free the server ip address to make memory management easier later.
This commit is contained in:
Robert Krakora 2011-08-16 13:31:52 +02:00 committed by Wim Taymans
parent 647e8c7af8
commit a5e028ba72
2 changed files with 6 additions and 3 deletions

View file

@ -1096,19 +1096,22 @@ create_sdp (GstRTSPClient * client, GstRTSPMedia * media)
info.server_proto = proto;
if (media->protocols & GST_RTSP_LOWER_TRANS_UDP_MCAST)
info.server_ip = MCAST_ADDRESS;
info.server_ip = g_strdup (MCAST_ADDRESS);
else
info.server_ip = client->server_ip;
info.server_ip = g_strdup (client->server_ip);
/* create an SDP for the media object */
if (!gst_rtsp_sdp_from_media (sdp, &info, media))
goto no_sdp;
g_free (info.server_ip);
return sdp;
/* ERRORS */
no_sdp:
{
g_free (info.server_ip);
gst_sdp_message_free (sdp);
return NULL;
}

View file

@ -29,7 +29,7 @@ G_BEGIN_DECLS
typedef struct {
const gchar *server_proto;
const gchar *server_ip;
gchar *server_ip;
} GstSDPInfo;
/* creating SDP */