mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Fix memory leaks in glib-compile resources
Based on a patch by Josselin Mouette, https://bugzilla.gnome.org/show_bug.cgi?id=685069
This commit is contained in:
parent
7c045e3423
commit
7f325939ba
@ -269,7 +269,6 @@ end_element (GMarkupParseContext *context,
|
||||
if (state->preproc_options)
|
||||
{
|
||||
gchar **options;
|
||||
gchar *stderr_child = NULL;
|
||||
guint i;
|
||||
gboolean xml_stripblanks = FALSE;
|
||||
gboolean to_pixdata = FALSE;
|
||||
@ -296,6 +295,7 @@ end_element (GMarkupParseContext *context,
|
||||
{
|
||||
gchar *argv[8];
|
||||
int status, fd, argc;
|
||||
gchar *stderr_child = NULL;
|
||||
|
||||
tmp_file = g_strdup ("resource-XXXXXXXX");
|
||||
if ((fd = g_mkstemp (tmp_file)) == -1)
|
||||
@ -325,6 +325,7 @@ end_element (GMarkupParseContext *context,
|
||||
G_SPAWN_STDOUT_TO_DEV_NULL,
|
||||
NULL, NULL, NULL, &stderr_child, &status, &my_error))
|
||||
{
|
||||
g_free (stderr_child);
|
||||
g_propagate_error (error, my_error);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -334,10 +335,10 @@ end_element (GMarkupParseContext *context,
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
_("Error processing input file with xmllint:\n%s"), stderr_child);
|
||||
g_free (stderr_child);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
g_free (stderr_child);
|
||||
g_free (real_file);
|
||||
real_file = g_strdup (tmp_file);
|
||||
}
|
||||
@ -382,6 +383,7 @@ end_element (GMarkupParseContext *context,
|
||||
NULL, NULL, NULL, &stderr_child, &status, &my_error))
|
||||
{
|
||||
g_propagate_error (error, my_error);
|
||||
g_free (stderr_child);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -389,10 +391,10 @@ end_element (GMarkupParseContext *context,
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
_("Error processing input file with to-pixdata:\n%s"), stderr_child);
|
||||
g_free (stderr_child);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
g_free (stderr_child);
|
||||
g_free (real_file);
|
||||
real_file = g_strdup (tmp_file2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user