CreateMetaFileW: Free memory on error

svn path=/trunk/; revision=42896
This commit is contained in:
Gregor Schneider 2009-08-23 23:09:55 +00:00
parent 91ae05b80d
commit c3d83ebfa9

View file

@ -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;