mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-11 09:18:20 +03:00
libotutil: Plug a leak
There's no need to allocate the variant builder on a heap, so allocate it on the stack and avoid a memory leak at the same time. Closes: #307 Approved by: cgwalters
This commit is contained in:
parent
e3e82c54c1
commit
2f2af9252d
@ -33,7 +33,10 @@
|
||||
GVariant *
|
||||
ot_gvariant_new_empty_string_dict (void)
|
||||
{
|
||||
return g_variant_builder_end (g_variant_builder_new (G_VARIANT_TYPE ("a{sv}")));
|
||||
g_auto(GVariantBuilder) builder = {{0,}};
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||
return g_variant_builder_end (&builder);
|
||||
}
|
||||
|
||||
GVariant *
|
||||
|
Loading…
Reference in New Issue
Block a user