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

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

 



Functions usbg_allocate_function() and usbg_allocate_binding()
had allocated sizeof(usbg_config) instead of usbg_function
and usbg_binding.

Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
---
 src/usbg.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/usbg.c b/src/usbg.c
index 3e1766e..68943c4 100644
--- a/src/usbg.c
+++ b/src/usbg.c
@@ -530,7 +530,7 @@ static usbg_function *usbg_allocate_function(char *path, char *name,
 {
 	usbg_function *f;
 
-	f = malloc(sizeof(usbg_config));
+	f = malloc(sizeof(usbg_function));
 	if (f) {
 		f->name = strdup(name);
 		f->path = strdup(path);
@@ -552,7 +552,7 @@ static usbg_binding *usbg_allocate_binding(char *path, char *name,
 {
 	usbg_binding *b;
 
-	b = malloc(sizeof(usbg_config));
+	b = malloc(sizeof(usbg_binding));
 	if (b) {
 		b->name = strdup(name);
 		b->path = strdup(path);
-- 
1.7.9.5

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