From d94ecdad25a7b8af200f550b8ce5911a3a926ee8 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 6 Jan 2009 13:09:06 +0000 Subject: [PATCH] Check the correct variable for NULL. --- src/uwatec_memomouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uwatec_memomouse.c b/src/uwatec_memomouse.c index 8af8c3c..d030f6a 100644 --- a/src/uwatec_memomouse.c +++ b/src/uwatec_memomouse.c @@ -311,7 +311,7 @@ uwatec_memomouse_read_packet_inner (uwatec_memomouse_device_t *device, unsigned // Allocate memory for the entire package. unsigned char *buffer = (unsigned char *) malloc (total * sizeof (unsigned char)); - if (package == NULL) { + if (buffer == NULL) { WARNING ("Memory allocation error."); return DEVICE_STATUS_MEMORY; }