summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2022-06-27 01:17:09 +0200
committerEmmanuele Bassi <ebassi@gmail.com>2023-01-08 15:42:43 +0000
commit1f0ebc321584e713f1090bda93d9c112a754e6e8 (patch)
treeedb88f50f169145f2d64988c8d211e88b24af95e
parentce8c37d3d6665903da5cf3a6ce5fdbfb442e6e3a (diff)
downloadgobject-introspection-1f0ebc321584e713f1090bda93d9c112a754e6e8.tar.gz
GIMarshallingTests: Free and copy GStrv instances
A GIMarshallingTestsBoxedStruct includes a GStrv, but we don't copy or free it properly.
-rw-r--r--tests/gimarshallingtests.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index f7ebe709..b1c765c2 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -4054,6 +4054,7 @@ gi_marshalling_tests_boxed_struct_copy (GIMarshallingTestsBoxedStruct *struct_)
*new_struct = *struct_;
new_struct->string_ = g_strdup (struct_->string_);
+ new_struct->g_strv = g_strdupv (struct_->g_strv);
return new_struct;
}
@@ -4064,6 +4065,7 @@ gi_marshalling_tests_boxed_struct_free (GIMarshallingTestsBoxedStruct *struct_)
if (struct_ != NULL)
{
g_free (struct_->string_);
+ g_clear_pointer (&struct_->g_strv, g_strfreev);
g_slice_free (GIMarshallingTestsBoxedStruct, struct_);
}
}