mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
Merge branch 'gbytes-double-free' into 'main'
gbytes: Add an assertion to placate static analysis See merge request GNOME/glib!4323
This commit is contained in:
commit
04543594d4
@ -490,6 +490,7 @@ try_steal_and_unref (GBytes *bytes,
|
|||||||
{
|
{
|
||||||
*size = bytes->size;
|
*size = bytes->size;
|
||||||
result = (gpointer)bytes->data;
|
result = (gpointer)bytes->data;
|
||||||
|
g_assert (result != NULL); /* otherwise the case of @bytes being freed can’t be distinguished */
|
||||||
g_free (bytes);
|
g_free (bytes);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user