mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
CreateMetaFileW: Free memory on error
svn path=/trunk/; revision=42896
This commit is contained in:
parent
91ae05b80d
commit
c3d83ebfa9
1 changed files with 3 additions and 0 deletions
|
@ -160,6 +160,7 @@ CreateMetaFileW(
|
||||||
(LPTSTR*) &lpszFile))
|
(LPTSTR*) &lpszFile))
|
||||||
{
|
{
|
||||||
// MFDRV_DeleteDC( dc->physDev );
|
// MFDRV_DeleteDC( dc->physDev );
|
||||||
|
LocalFree(pmfDC);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,12 +168,14 @@ CreateMetaFileW(
|
||||||
CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE)
|
CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
// MFDRV_DeleteDC( dc->physDev );
|
// MFDRV_DeleteDC( dc->physDev );
|
||||||
|
LocalFree(pmfDC);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!WriteFile( hFile, &pmfDC->mh, sizeof(pmfDC->mh), NULL, NULL ))
|
if (!WriteFile( hFile, &pmfDC->mh, sizeof(pmfDC->mh), NULL, NULL ))
|
||||||
{
|
{
|
||||||
// MFDRV_DeleteDC( dc->physDev );
|
// MFDRV_DeleteDC( dc->physDev );
|
||||||
|
LocalFree(pmfDC);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
pmfDC->hFile = hFile;
|
pmfDC->hFile = hFile;
|
||||||
|
|
Loading…
Reference in a new issue