avoid sneaky double free

Noticed by:	Coverity Prevent analysis tool
Reviewed by:	scottl
This commit is contained in:
sam 2005-02-25 00:16:53 +00:00
parent 9ad2b03bb5
commit 95526fd399
2 changed files with 10 additions and 2 deletions

View File

@ -781,7 +781,11 @@ void hpt_rebuild_data_block(IAL_ADAPTER_T *pAdapter, PVDevice pArray, UCHAR flag
result = pCmd->Result;
FreeCommand(_VBUS_P pCmd);
if (buffer) free(buffer, M_DEVBUF);
if (buffer) {
free(buffer, M_DEVBUF);
/* beware of goto retry_cmd below */
buffer = NULL;
}
KdPrintI(("cmd finished %d", result));
switch(result)

View File

@ -781,7 +781,11 @@ void hpt_rebuild_data_block(IAL_ADAPTER_T *pAdapter, PVDevice pArray, UCHAR flag
result = pCmd->Result;
FreeCommand(_VBUS_P pCmd);
if (buffer) free(buffer, M_DEVBUF);
if (buffer) {
free(buffer, M_DEVBUF);
/* beware of goto retry_cmd below */
buffer = NULL;
}
KdPrintI(("cmd finished %d", result));
switch(result)