Hi All,
I found this bug in kio.c using cppcheck and I try to fix.
Cheers,
Manuele
=== modified file 'uspace/app/kio/kio.c'
--- uspace/app/kio/kio.c	2014-08-16 00:02:04 +0000
+++ uspace/app/kio/kio.c	2016-07-06 08:25:10 +0000
@@ -78,13 +78,16 @@
  */
 static void producer(size_t length, wchar_t *data)
 {
+	if (data == NULL)
+		return;
+
 	item_t *item = (item_t *) malloc(sizeof(item_t));
 	if (item == NULL)
 		return;
 	
 	size_t sz = sizeof(wchar_t) * length;
 	wchar_t *buf = (wchar_t *) malloc(sz);
-	if (data == NULL) {
+	if (buf == NULL) {
 		free(item);
 		return;
 	}

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to