client: fix GSocketAddress leak in gst_rtsp_client_accept
authorDavid Svensson Fors <davidsf at axis.com>
Wed, 6 Jun 2012 12:49:02 +0000 (14:49 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 6 Jun 2012 12:49:40 +0000 (14:49 +0200)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=677463

gst/rtsp-server/rtsp-client.c

index b828002..e35efee 100644 (file)
@@ -1910,6 +1910,7 @@ gst_rtsp_client_accept (GstRTSPClient * client, GSocket * socket,
   addrlen = sizeof (addr);
   if (!g_socket_address_to_native (addres, &addr, addrlen, error))
     goto native_failed;
+  g_object_unref (addres);
 
   if (getnameinfo ((struct sockaddr *) &addr, addrlen, ip, sizeof (ip), NULL, 0,
           NI_NUMERICHOST) != 0)
@@ -1960,6 +1961,7 @@ no_address:
   }
 native_failed:
   {
+    g_object_unref (addres);
     GST_ERROR ("could not get native address %s", (*error)->message);
     return FALSE;
   }