diff --git a/dlls/atl100/atl.c b/dlls/atl100/atl.c index 4e2ba9f80ee..61477aebace 100644 --- a/dlls/atl100/atl.c +++ b/dlls/atl100/atl.c @@ -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));