mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
girepository/compiler: Free the parser when not needed
The compiler code was full of leaks and nothing really checked on them. While it's not a big deal per se, per the nature of it, it's still better to ensure that memory management is well done so that there are no problems when using it with sanitizers. So, the source of the problems was not freeing the parser, but that wasn't enough, more to come...
This commit is contained in:
parent
311367620a
commit
47cf6387ad
@ -218,6 +218,7 @@ main (int argc, char **argv)
|
|||||||
char *message = g_strdup_printf (_("Error parsing file ‘%s’: %s"), input[0], error->message);
|
char *message = g_strdup_printf (_("Error parsing file ‘%s’: %s"), input[0], error->message);
|
||||||
g_fprintf (stderr, "%s\n", message);
|
g_fprintf (stderr, "%s\n", message);
|
||||||
g_free (message);
|
g_free (message);
|
||||||
|
gi_ir_parser_free (parser);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -253,10 +254,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
g_debug ("[building] done");
|
g_debug ("[building] done");
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* No point */
|
|
||||||
gi_ir_parser_free (parser);
|
gi_ir_parser_free (parser);
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user