summaryrefslogtreecommitdiff
path: root/tests/testhelpermodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testhelpermodule.c')
-rw-r--r--tests/testhelpermodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c
index e6f6ffe4..eb17af87 100644
--- a/tests/testhelpermodule.c
+++ b/tests/testhelpermodule.c
@@ -362,11 +362,12 @@ test_paramspec_callback (GObject *object)
static GValue *
test_gvalue_callback (GObject *object, const GValue *v)
{
- GValue *ret = g_malloc0 (sizeof (GValue));
+ GValue *ret;
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
g_return_val_if_fail (G_IS_VALUE (v), NULL);
+ ret = g_malloc0 (sizeof (GValue));
g_value_init (ret, G_VALUE_TYPE (v));
g_value_copy (v, ret);
return ret;
@@ -375,10 +376,11 @@ test_gvalue_callback (GObject *object, const GValue *v)
static GValue *
test_gvalue_ret_callback (GObject *object, GType type)
{
- GValue *ret = g_malloc0 (sizeof (GValue));
+ GValue *ret;
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
+ ret = g_malloc0 (sizeof (GValue));
g_value_init (ret, type);
switch (type) {