twain_32: Add missing HeapFree's on error patch (found by smatch).

This commit is contained in:
Michael Stefaniuc 2006-05-09 00:51:58 +02:00 committed by Alexandre Julliard
parent 81c2ef5419
commit 8d7dcb65a2
1 changed files with 2 additions and 0 deletions

View File

@ -233,12 +233,14 @@ TW_UINT16 TWAIN_OpenDS (pTW_IDENTITY pOrigin, TW_MEMREF pData)
if (!hmod) {
ERR("Failed to load TWAIN Source %s\n", modname);
DSM_twCC = TWCC_OPERATIONERROR;
HeapFree(GetProcessHeap(), 0, newSource);
return TWRC_FAILURE;
}
newSource->hmod = hmod;
newSource->dsEntry = (DSENTRYPROC)GetProcAddress(hmod, "DS_Entry");
if (TWRC_SUCCESS != newSource->dsEntry (pOrigin, DG_CONTROL, DAT_IDENTITY, MSG_OPENDS, pIdentity)) {
DSM_twCC = TWCC_OPERATIONERROR;
HeapFree(GetProcessHeap(), 0, newSource);
return TWRC_FAILURE;
}
/* Assign name and id for the opened data source */