mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
resources: Plug a mem leak
==26427== 24 bytes in 1 blocks are definitely lost in loss record 608 of 965 ==26427== at 0x402AD89: malloc (vg_replace_malloc.c:236) ==26427== by 0x4084724: standard_malloc (gmem.c:85) ==26427== by 0x40847C7: g_malloc (gmem.c:159) ==26427== by 0x409B1E1: g_slice_alloc (gslice.c:1003) ==26427== by 0x40BC038: g_variant_get_child_value (gvariant-core.c:969) ==26427== by 0x40BA89F: g_variant_valist_get (gvariant.c:4482) ==26427== by 0x40BAC23: g_variant_get_va (gvariant.c:4681) ==26427== by 0x40BAB29: g_variant_get (gvariant.c:4633) ==26427== by 0x4228BA5: do_lookup (gresource.c:293) ==26427== by 0x4228F51: g_resource_get_info (gresource.c:493)
This commit is contained in:
parent
2f4b46e378
commit
fa37057169
@ -295,24 +295,23 @@ static gboolean do_lookup (GResource *resource,
|
|||||||
&_flags,
|
&_flags,
|
||||||
&array);
|
&array);
|
||||||
|
|
||||||
if (!res)
|
if (size)
|
||||||
{
|
*size = _size;
|
||||||
if (size)
|
if (flags)
|
||||||
*size = _size;
|
*flags = _flags;
|
||||||
if (flags)
|
if (data)
|
||||||
*flags = _flags;
|
*data = g_variant_get_data (array);
|
||||||
if (data)
|
if (data_size)
|
||||||
*data = g_variant_get_data (array);
|
{
|
||||||
if (data_size)
|
/* Don't report trailing newline that non-compressed files has */
|
||||||
{
|
if (_flags & G_RESOURCE_FLAGS_COMPRESSED)
|
||||||
/* Don't report trailing newline that non-compressed files has */
|
*data_size = g_variant_get_size (array);
|
||||||
if (_flags & G_RESOURCE_FLAGS_COMPRESSED)
|
else
|
||||||
*data_size = g_variant_get_size (array);
|
*data_size = g_variant_get_size (array) - 1;
|
||||||
else
|
}
|
||||||
*data_size = g_variant_get_size (array) - 1;
|
g_variant_unref (array);
|
||||||
}
|
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (free_path);
|
g_free (free_path);
|
||||||
|
Loading…
Reference in New Issue
Block a user