gplugin/gplugin

Fix leaks of regex results.
develop/asan
2019-01-31, Elliott Sales de Andrade
dfc5a2328fce
Parents a164b787bc7d
Children 08abb4bde2d4
Fix leaks of regex results.
--- a/gplugin/gplugin-manager.c Thu Jan 31 22:01:38 2019 -0500
+++ b/gplugin/gplugin-manager.c Thu Jan 31 22:06:35 2019 -0500
@@ -639,8 +639,12 @@
/* now look for a plugin matching the id */
matches = gplugin_manager_find_plugins(oid);
- if(matches == NULL)
+ if(matches == NULL) {
+ g_free(oid);
+ g_free(oop);
+ g_free(over);
continue;
+ }
/* now iterate the matches and check if we need to check their
* version.
@@ -699,6 +703,10 @@
}
}
+ g_free(oid);
+ g_free(oop);
+ g_free(over);
+
if(found)
break;
}
--- a/gplugin/gplugin-version.c Thu Jan 31 22:01:38 2019 -0500
+++ b/gplugin/gplugin-version.c Thu Jan 31 22:06:35 2019 -0500
@@ -107,6 +107,8 @@
if(extra)
*extra = g_match_info_fetch_named(info, "extra");
+ g_match_info_unref(info);
+
return TRUE;
}