> -----Original Message-----
> From: David Laight [mailto:[email protected]]
> Sent: Wednesday, April 02, 2014 3:03 PM
> To: Krzysztof Opasiak; [email protected]; linux-
> [email protected]
> Cc: Andrzej Pietrasiewicz; Karol Lewandowski; Stanislaw Wadas;
> [email protected]; Marek Szyprowski; Robert Baldyga
> Subject: RE: [PATCH 2/5] libusbg: Fix wrong malloc sizes in
> allocate functions.
> 
> From: Krzysztof Opasiak
> > Functions usbg_allocate_function() and usbg_allocate_binding()
> > had allocated sizeof(usbg_config) instead of usbg_function
> > and usbg_binding.
> ...
> >     usbg_function *f;
> >
> > -   f = malloc(sizeof(usbg_config));
> > +   f = malloc(sizeof(usbg_function));
> 
> Use the much safer:
>       f = malloc(sizeof (*f));

Really good idea. Will be changed in v2.

--
BR's
Krzysiek
 
 



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to