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:
Ryan Lortie 2011-01-28 08:23:11 -05:00
parent 8602a3a682
commit d4209c1c41

View File

@ -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);
} }
} }