Author: pschweitzer
Date: Sun Apr 6 19:48:22 2014
New Revision: 62672
URL:
http://svn.reactos.org/svn/reactos?rev=62672&view=rev
Log:
[ATACTL]
- Fix resource leak
- Fix uninit field in struct
CID #716281
CID #716748
CID #716749
CID #716751
CID #716752
CID #716753
CID #731454
Modified:
trunk/reactos/base/applications/atactl/atactl.cpp
Modified: trunk/reactos/base/applications/atactl/atactl.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/atactl/a…
==============================================================================
--- trunk/reactos/base/applications/atactl/atactl.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/applications/atactl/atactl.cpp [iso-8859-1] Sun Apr 6 19:48:22
2014
@@ -727,6 +727,7 @@
}
*/
+ addr.Length = sizeof(addr);
addr.PortNumber = -1;
addr.PathId = inquiryData->PathId;
addr.TargetId = inquiryData->TargetId;
@@ -986,12 +987,14 @@
h = ata_open_dev(dev_name);
if(!h)
return FALSE;
+ addr.Length = sizeof(addr);
addr.PortNumber = bus_id;
len = sizeof(ADAPTERINFO)+sizeof(CHANINFO)*AHCI_MAX_PORT;
if(!g_AdapterInfo) {
AdapterInfo = (PADAPTERINFO)GlobalAlloc(GMEM_FIXED, len);
if(!AdapterInfo) {
+ ata_close_dev(h);
return FALSE;
}
} else {
@@ -1111,6 +1114,7 @@
h = ata_open_dev(dev_name);
if(!h)
return FALSE;
+ addr.Length = sizeof(addr);
addr.PortNumber = bus_id;
addr.PathId = (UCHAR)(dev_id >> 16);
addr.TargetId = (UCHAR)(dev_id >> 8);
@@ -1155,6 +1159,7 @@
h = ata_open_dev(dev_name);
if(!h)
return FALSE;
+ addr.Length = sizeof(addr);
addr.PortNumber = bus_id;
addr.PathId = (UCHAR)(dev_id >> 16);
addr.TargetId = (UCHAR)(dev_id >> 8);
@@ -1213,6 +1218,7 @@
h = ata_open_dev(dev_name);
if(!h)
return FALSE;
+ addr.Length = sizeof(addr);
addr.PortNumber = bus_id;
addr.PathId = (UCHAR)(dev_id >> 16);
addr.TargetId = (UCHAR)(dev_id >> 8);
@@ -1268,6 +1274,7 @@
if((UCHAR)(dev_id) != 0xff &&
(UCHAR)(dev_id >> 8) != 0xff) {
+ addr.Length = sizeof(addr);
addr.PortNumber = bus_id;
addr.PathId = (UCHAR)(dev_id >> 16);
addr.TargetId = 0;