g_variant_unref: add g_return_if_fail() NULL check

Patch from Rodney Dawes.
This commit is contained in:
Ryan Lortie
2011-10-03 11:12:01 -04:00
parent add049e1bf
commit 35a9f3a7f2

View File

@@ -614,6 +614,8 @@ g_variant_is_trusted (GVariant *value)
void void
g_variant_unref (GVariant *value) g_variant_unref (GVariant *value)
{ {
g_return_if_fail (value != NULL);
if (g_atomic_int_dec_and_test (&value->ref_count)) if (g_atomic_int_dec_and_test (&value->ref_count))
{ {
if G_UNLIKELY (value->state & STATE_LOCKED) if G_UNLIKELY (value->state & STATE_LOCKED)