Re: [PATCH BlueZ v2 6/9] Fix memory leak when loading keys

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

 



Hi Marcel,

On Thu, Jul 7, 2011 at 4:35 AM, Marcel Holtmann <marcel@xxxxxxxxxxxx> wrote:
>> +             n->data = g_malloc0(sizeof(*orig) + orig->dlen);
>> +             memcpy(n->data, orig, sizeof(*orig) + orig->dlen);
>
> you don't need to add a memset via g_malloc0 here. And do we really not
> wanna check the memory allocation here?

What about using g_memdup() ? it does the equivalent of both calls.

Unfortunately, there is no "g_try_memdup"...

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