Re: [PATCH v3] Simplify eir_parse_uuid* functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Frédéric,

2011/10/20 Frédéric Danis <frederic.danis@xxxxxxxxxxxxxxx>:
> +                       if (eir->name)
> +                               g_free(eir->name);

You don't need to check for NULL before passing a pointer to g_free().
IMHO just "g_free(eir->name)" is clearer.

> +
> +                       eir->name = g_strndup((char *) &eir_data[2],
>                                                                field_len - 1);
> -                       else
> -                               eir->name = g_strdup("");
>                        eir->name_complete = eir_data[1] == EIR_NAME_COMPLETE;
>                        break;

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux