mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-31 22:23:39 +02: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:
@@ -629,6 +629,7 @@ g_variant_unref (GVariant *value)
|
||||
else
|
||||
g_variant_release_children (value);
|
||||
|
||||
memset (value, 0, sizeof (GVariant));
|
||||
g_slice_free (GVariant, value);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user