[PATCH] libmbim-glib: Fix a memory leak in unitttest
Aleksander Morgado
aleksander at aleksander.es
Tue Jul 22 02:24:39 PDT 2014
Hey Yunlian!
On 22/07/14 02:29, Yunlian Jiang wrote:
> Original bug entry is at
> https://code.google.com/p/chromium/issues/detail?id=394412&q=libmbim&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified
>
> In the unittest, it fails to free |provider_id|
>
> diff --git a/src/libmbim-glib/test/test-message-parser.c
> b/src/libmbim-glib/test/test-message-parser.c
> index d25374c..470bde6 100644
> --- a/src/libmbim-glib/test/test-message-parser.c
> +++ b/src/libmbim-glib/test/test-message-parser.c
> @@ -653,6 +653,7 @@ test_message_parser_basic_connect_register_state (void)
> MBIM_DATA_CLASS_HSUPA));
> g_assert_cmpuint (current_cellular_class, ==, MBIM_CELLULAR_CLASS_GSM);
> g_assert_cmpstr (provider_id, ==, "26006");
> + g_free(provider_id);
> g_assert (provider_name == NULL);
> g_assert (roaming_text == NULL);
> g_assert_cmpuint (registration_flag, ==,
> MBIM_REGISTRATION_FLAG_PACKET_SERVICE_AUTOMATIC_ATTACH);
>
> Thanks
>
Thanks for the patch, but can you provide one that cleanly applies in
git? i.e. created with git format-patch or git-send.
Plus, a whitespace between the method name and the parenthesis :)
I know it's a one liner, but I'm assuming it's worth for you to spend
some time playing with git patch generation. If it's not worth for you
or you don't want to, let me know and I'll just do the change myself :)
Cheers!
--
Aleksander
https://aleksander.es
More information about the libmbim-devel
mailing list