mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
windows: ACH: Error handling cleanup
This commit is contained in:
parent
180ff193aa
commit
31249e6e59
1 changed files with 12 additions and 7 deletions
|
@ -29,7 +29,8 @@ struct AcceleratedCryptographicHash::impl {
|
||||||
0)))
|
0)))
|
||||||
{
|
{
|
||||||
qDebug() << "BCryptOpenAlgorithmProvider returned Error " << status;
|
qDebug() << "BCryptOpenAlgorithmProvider returned Error " << status;
|
||||||
goto Cleanup;
|
cleanup();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//calculate the size of the buffer to hold the hash object
|
//calculate the size of the buffer to hold the hash object
|
||||||
|
@ -42,7 +43,8 @@ struct AcceleratedCryptographicHash::impl {
|
||||||
0)))
|
0)))
|
||||||
{
|
{
|
||||||
qDebug() << "BCryptGetProperty returned Error " << status;
|
qDebug() << "BCryptGetProperty returned Error " << status;
|
||||||
goto Cleanup;
|
cleanup();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//allocate the hash object on the heap
|
//allocate the hash object on the heap
|
||||||
|
@ -50,7 +52,8 @@ struct AcceleratedCryptographicHash::impl {
|
||||||
if(NULL == pbHashObject)
|
if(NULL == pbHashObject)
|
||||||
{
|
{
|
||||||
qDebug() << "memory allocation failed";
|
qDebug() << "memory allocation failed";
|
||||||
goto Cleanup;
|
cleanup();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//calculate the length of the hash
|
//calculate the length of the hash
|
||||||
|
@ -63,7 +66,8 @@ struct AcceleratedCryptographicHash::impl {
|
||||||
0)))
|
0)))
|
||||||
{
|
{
|
||||||
qDebug() << "BCryptGetProperty returned Error " << status;
|
qDebug() << "BCryptGetProperty returned Error " << status;
|
||||||
goto Cleanup;
|
cleanup();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//allocate the hash buffer on the heap
|
//allocate the hash buffer on the heap
|
||||||
|
@ -92,7 +96,7 @@ struct AcceleratedCryptographicHash::impl {
|
||||||
}
|
}
|
||||||
|
|
||||||
~impl() {
|
~impl() {
|
||||||
cleanup()
|
cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup() {
|
void cleanup() {
|
||||||
|
@ -127,7 +131,8 @@ struct AcceleratedCryptographicHash::impl {
|
||||||
0)))
|
0)))
|
||||||
{
|
{
|
||||||
qDebug() << "BCryptHashData returned Error " << status;
|
qDebug() << "BCryptHashData returned Error " << status;
|
||||||
goto Cleanup;
|
cleanup();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +150,7 @@ struct AcceleratedCryptographicHash::impl {
|
||||||
0)))
|
0)))
|
||||||
{
|
{
|
||||||
qDebug() << "BCryptFinishHash returned Error " << status;
|
qDebug() << "BCryptFinishHash returned Error " << status;
|
||||||
cleanup()
|
cleanup();
|
||||||
return {};
|
return {};
|
||||||
} else {
|
} else {
|
||||||
// No cleanup required, as the dtor of this class will do so.
|
// No cleanup required, as the dtor of this class will do so.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue