From: Jens Georg Date: Fri, 4 May 2012 08:19:31 +0000 (+0200) Subject: Don't leak MatchInfo X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f6a89821aa12e5427fb749f2b4920c6d1438fd0;p=profile%2Fivi%2FGSSDP.git Don't leak MatchInfo --- 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);