Browse Source

Bugfix: ztex: Initialize fw_buf pointer to NULL so a free before allocation is safe

Luke Dashjr 12 years ago
parent
commit
f1cfb962f5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libztex.c

+ 1 - 1
libztex.c

@@ -63,7 +63,7 @@ static enum check_result libztex_checkDevice(struct libusb_device *dev)
 	struct libusb_device_descriptor desc;
 	int i, ret = CHECK_ERROR, err, cnt;
 	size_t got_bytes, length;
-	unsigned char buf[64], *fw_buf;
+	unsigned char buf[64], *fw_buf = NULL;
 	char *firmware = "ztex_ufm1_15y1.bin";
 
 	err = libusb_get_device_descriptor(dev, &desc);