[gssdp] Don't leak MatchInfo



commit 8f6a89821aa12e5427fb749f2b4920c6d1438fd0
Author: Jens Georg <mail jensge org>
Date:   Fri May 4 10:19:31 2012 +0200

    Don't leak MatchInfo

 libgssdp/gssdp-resource-browser.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libgssdp/gssdp-resource-browser.c b/libgssdp/gssdp-resource-browser.c
index 73b47fa..be19cb2 100644
--- a/libgssdp/gssdp-resource-browser.c
+++ b/libgssdp/gssdp-resource-browser.c
@@ -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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]