RE: [PATCH 2/5] libusbg: Fix wrong malloc sizes in allocate functions.

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

 



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));

	David



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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux