Commit f0b685d5 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

msacm32: Add missing HeapALloc failure checks (Coverity).

parent 102a3b98
...@@ -289,18 +289,29 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileNa ...@@ -289,18 +289,29 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileNa
debugstr_w(pszDriverAlias), debugstr_w(pszFileName), pLocalDriver); debugstr_w(pszDriverAlias), debugstr_w(pszFileName), pLocalDriver);
padid = HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID)); padid = HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
if (!padid)
return NULL;
padid->obj.dwType = WINE_ACMOBJ_DRIVERID; padid->obj.dwType = WINE_ACMOBJ_DRIVERID;
padid->obj.pACMDriverID = padid; padid->obj.pACMDriverID = padid;
padid->pszDriverAlias = NULL; padid->pszDriverAlias = NULL;
if (pszDriverAlias) if (pszDriverAlias)
{ {
padid->pszDriverAlias = HeapAlloc( MSACM_hHeap, 0, (strlenW(pszDriverAlias)+1) * sizeof(WCHAR) ); padid->pszDriverAlias = HeapAlloc( MSACM_hHeap, 0, (strlenW(pszDriverAlias)+1) * sizeof(WCHAR) );
if (!padid->pszDriverAlias) {
HeapFree(MSACM_hHeap, 0, padid);
return NULL;
}
strcpyW( padid->pszDriverAlias, pszDriverAlias ); strcpyW( padid->pszDriverAlias, pszDriverAlias );
} }
padid->pszFileName = NULL; padid->pszFileName = NULL;
if (pszFileName) if (pszFileName)
{ {
padid->pszFileName = HeapAlloc( MSACM_hHeap, 0, (strlenW(pszFileName)+1) * sizeof(WCHAR) ); padid->pszFileName = HeapAlloc( MSACM_hHeap, 0, (strlenW(pszFileName)+1) * sizeof(WCHAR) );
if (!padid->pszFileName) {
HeapFree(MSACM_hHeap, 0, padid->pszDriverAlias);
HeapFree(MSACM_hHeap, 0, padid);
return NULL;
}
strcpyW( padid->pszFileName, pszFileName ); strcpyW( padid->pszFileName, pszFileName );
} }
padid->pLocalDriver = pLocalDriver; padid->pLocalDriver = pLocalDriver;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment