atl100: Fix a mem leak on an error path (Smatch).

oldstable
Michael Stefaniuc 2013-01-05 00:20:57 +01:00 committed by Alexandre Julliard
parent 4a685ebea3
commit 4bdb5b55ec
1 changed files with 3 additions and 1 deletions

View File

@ -331,8 +331,10 @@ HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex,
return E_OUTOFMEMORY;
path_len = GetModuleFileNameW(inst, path, MAX_PATH);
if(!path_len)
if(!path_len) {
heap_free(path);
return HRESULT_FROM_WIN32(GetLastError());
}
if(index_len)
memcpy(path+path_len, lpszIndex, (index_len+1)*sizeof(WCHAR));