diff options
author | Torsten Schönfeld <kaffeetisch@gmx.de> | 2013-01-19 16:03:08 +0100 |
---|---|---|
committer | Torsten Schönfeld <kaffeetisch@gmx.de> | 2013-01-20 14:08:16 +0100 |
commit | c66bd85d20de927fa220f770c15b3c312298f019 (patch) | |
tree | ec9f9f18be816fd82e6af73f5468069975be4422 /tests/gimarshallingtests.c | |
parent | e602311ca686ee879b370213c69bb06f50c195b4 (diff) | |
download | gobject-introspection-c66bd85d20de927fa220f770c15b3c312298f019.tar.gz |
tests: Avoid handing out uninitialized memory
gi_marshalling_tests_boxed_struct_out and
gi_marshalling_tests_boxed_struct_inout allocated memory without completely
initializing it.
https://bugzilla.gnome.org/show_bug.cgi?id=692084
Diffstat (limited to 'tests/gimarshallingtests.c')
-rw-r--r-- | tests/gimarshallingtests.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 21d31e00..7855dd71 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -3738,7 +3738,7 @@ gi_marshalling_tests_boxed_struct_out (GIMarshallingTestsBoxedStruct **struct_) static GIMarshallingTestsBoxedStruct *new_struct = NULL; if (new_struct == NULL) { - new_struct = g_new(GIMarshallingTestsBoxedStruct, 1); + new_struct = g_new0(GIMarshallingTestsBoxedStruct, 1); new_struct->long_ = 42; } @@ -3755,7 +3755,7 @@ gi_marshalling_tests_boxed_struct_inout (GIMarshallingTestsBoxedStruct **struct_ { g_assert_cmpint((*struct_)->long_, ==, 42); - (*struct_) = g_slice_new (GIMarshallingTestsBoxedStruct); + (*struct_) = g_slice_new0 (GIMarshallingTestsBoxedStruct); (*struct_)->long_ = 0; } |