validate: utils: Plug some leaks

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5636>
This commit is contained in:
Thibault Saunier 2023-11-13 18:37:21 -03:00 committed by GStreamer Marge Bot
parent ef62696505
commit 2f7d402f7b

View file

@ -1267,6 +1267,10 @@ gst_validate_replace_variables_in_string (gpointer source,
} }
if (!var_value) { if (!var_value) {
g_free (varname);
g_free (pvarname);
g_free (string);
g_clear_pointer (&match_info, g_match_info_free);
if (!(flags & GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_NO_FAILURE)) { if (!(flags & GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_NO_FAILURE)) {
gst_validate_error_structure (source, gst_validate_error_structure (source,
"Trying to use undefined variable `%s`.\n" "Trying to use undefined variable `%s`.\n"
@ -1276,6 +1280,7 @@ gst_validate_replace_variables_in_string (gpointer source,
varname, gst_structure_to_string (local_vars), varname, gst_structure_to_string (local_vars),
(flags & GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_LOCAL_ONLY) ? (flags & GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_LOCAL_ONLY) ?
": unused" : gst_structure_to_string (global_vars)); ": unused" : gst_structure_to_string (global_vars));
} }
return NULL; return NULL;