Don't leak MatchInfo
authorJens Georg <mail@jensge.org>
Fri, 4 May 2012 08:19:31 +0000 (10:19 +0200)
committerJens Georg <mail@jensge.org>
Fri, 4 May 2012 08:19:31 +0000 (10:19 +0200)
libgssdp/gssdp-resource-browser.c

index 73b47fa..be19cb2 100644 (file)
@@ -848,11 +848,17 @@ check_target_compat (GSSDPResourceBrowser *resource_browser,
         }
 
         /* If there was no version to match, we're done */
-        if (resource_browser->priv->version == 0)
+        if (resource_browser->priv->version == 0) {
+                g_match_info_free (info);
+
                 return TRUE;
+        }
+
+        if (g_match_info_get_match_count (info) != 2) {
+                g_match_info_free (info);
 
-        if (g_match_info_get_match_count (info) != 2)
                 return FALSE;
+        }
 
         version = atoi ((tmp = g_match_info_fetch (info, 1)));
         g_free (tmp);