twain_32: Add missing HeapFree's on error patch (found by smatch).
This commit is contained in:
parent
81c2ef5419
commit
8d7dcb65a2
|
@ -233,12 +233,14 @@ TW_UINT16 TWAIN_OpenDS (pTW_IDENTITY pOrigin, TW_MEMREF pData)
|
||||||
if (!hmod) {
|
if (!hmod) {
|
||||||
ERR("Failed to load TWAIN Source %s\n", modname);
|
ERR("Failed to load TWAIN Source %s\n", modname);
|
||||||
DSM_twCC = TWCC_OPERATIONERROR;
|
DSM_twCC = TWCC_OPERATIONERROR;
|
||||||
|
HeapFree(GetProcessHeap(), 0, newSource);
|
||||||
return TWRC_FAILURE;
|
return TWRC_FAILURE;
|
||||||
}
|
}
|
||||||
newSource->hmod = hmod;
|
newSource->hmod = hmod;
|
||||||
newSource->dsEntry = (DSENTRYPROC)GetProcAddress(hmod, "DS_Entry");
|
newSource->dsEntry = (DSENTRYPROC)GetProcAddress(hmod, "DS_Entry");
|
||||||
if (TWRC_SUCCESS != newSource->dsEntry (pOrigin, DG_CONTROL, DAT_IDENTITY, MSG_OPENDS, pIdentity)) {
|
if (TWRC_SUCCESS != newSource->dsEntry (pOrigin, DG_CONTROL, DAT_IDENTITY, MSG_OPENDS, pIdentity)) {
|
||||||
DSM_twCC = TWCC_OPERATIONERROR;
|
DSM_twCC = TWCC_OPERATIONERROR;
|
||||||
|
HeapFree(GetProcessHeap(), 0, newSource);
|
||||||
return TWRC_FAILURE;
|
return TWRC_FAILURE;
|
||||||
}
|
}
|
||||||
/* Assign name and id for the opened data source */
|
/* Assign name and id for the opened data source */
|
||||||
|
|
Loading…
Reference in New Issue