[PATCH 2/2] bearer-mbim: parse replies on failure

Aleksander Morgado aleksander at lanedo.com
Thu Dec 19 09:44:07 PST 2013


On 19/12/13 18:29, Aleksander Morgado wrote:
>>      if (response &&
>> > -        mbim_message_command_done_get_result (response, &error) &&
>> > +        (mbim_message_command_done_get_result (response, &error) ||
>> > +         error->code == MBIM_STATUS_ERROR_FAILURE) &&
>> >          mbim_message_connect_response_parse (
>> >              response,
>> >              &session_id,
>> > @@ -440,6 +441,7 @@ connect_set_ready (MbimDevice *device,
>> >              &nw_error,
>> >              &error)) {
>> >          if (nw_error) {
>> > +            g_error_free (error);
>> >              error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error);
>> >              mm_dbg ("NwError: '%s' (%u)", error->message, nw_error);
>> >          } else {
> I'll rewrite a bit that logic, because there may be the case where we
> get an error in mbim_message_command_done_get_result() with
> MBIM_STATUS_ERROR_FAILURE, and *also* afterwards a
> mbim_message_connect_response_parse() error. Which would lead to a leak
> in the first GError we got.

How about this? (attached)

-- 
Aleksander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-bearer-mbim-parse-replies-on-failure.patch
Type: text/x-patch
Size: 7447 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/modemmanager-devel/attachments/20131219/cfcf503e/attachment.bin>


More information about the ModemManager-devel mailing list