mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 09:46:17 +01:00
GVariant: clear memory before releasing it
Bug #640807 makes a reasonable case for why it's better to have your program crash outright in the case of memory errors. With this modification, GVariant is far more likely to do that in the case that a GVariant pointer is used shortly after being freed.
This commit is contained in:
parent
8602a3a682
commit
d4209c1c41
@ -629,6 +629,7 @@ g_variant_unref (GVariant *value)
|
|||||||
else
|
else
|
||||||
g_variant_release_children (value);
|
g_variant_release_children (value);
|
||||||
|
|
||||||
|
memset (value, 0, sizeof (GVariant));
|
||||||
g_slice_free (GVariant, value);
|
g_slice_free (GVariant, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user