Commit 56026299 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

Remove more redundant NULL checks before HeapFree (found by Smatch).

parent 4e66d479
...@@ -274,7 +274,7 @@ static HRESULT iterate_section_fields(HINF hinf, PCWSTR section, PCWSTR key, ...@@ -274,7 +274,7 @@ static HRESULT iterate_section_fields(HINF hinf, PCWSTR section, PCWSTR key,
hr = S_OK; hr = S_OK;
done: done:
if (buffer && buffer != static_buffer) HeapFree(GetProcessHeap(), 0, buffer); if (buffer != static_buffer) HeapFree(GetProcessHeap(), 0, buffer);
return hr; return hr;
} }
......
...@@ -787,7 +787,7 @@ static BOOL iterate_section_fields( HINF hinf, PCWSTR section, PCWSTR key, ...@@ -787,7 +787,7 @@ static BOOL iterate_section_fields( HINF hinf, PCWSTR section, PCWSTR key,
} }
ret = TRUE; ret = TRUE;
done: done:
if (buffer && buffer != static_buffer) HeapFree( GetProcessHeap(), 0, buffer ); if (buffer != static_buffer) HeapFree( GetProcessHeap(), 0, buffer );
return ret; return ret;
} }
......
...@@ -220,10 +220,10 @@ HRESULT WINAPI AssocQueryKeyA(ASSOCF cfFlags, ASSOCKEY assockey, LPCSTR pszAssoc ...@@ -220,10 +220,10 @@ HRESULT WINAPI AssocQueryKeyA(ASSOCF cfFlags, ASSOCKEY assockey, LPCSTR pszAssoc
hRet = AssocQueryKeyW(cfFlags, assockey, lpszAssocW, lpszExtraW, phkeyOut); hRet = AssocQueryKeyW(cfFlags, assockey, lpszAssocW, lpszExtraW, phkeyOut);
} }
if (lpszAssocW && lpszAssocW != szAssocW) if (lpszAssocW != szAssocW)
HeapFree(GetProcessHeap(), 0, lpszAssocW); HeapFree(GetProcessHeap(), 0, lpszAssocW);
if (lpszExtraW && lpszExtraW != szExtraW) if (lpszExtraW != szExtraW)
HeapFree(GetProcessHeap(), 0, lpszExtraW); HeapFree(GetProcessHeap(), 0, lpszExtraW);
return hRet; return hRet;
...@@ -312,14 +312,14 @@ HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc, ...@@ -312,14 +312,14 @@ HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc,
WideCharToMultiByte(CP_ACP,0,szReturnW,-1,pszOut,dwLenOut,0,0); WideCharToMultiByte(CP_ACP,0,szReturnW,-1,pszOut,dwLenOut,0,0);
*pcchOut = dwLenOut; *pcchOut = dwLenOut;
if (lpszReturnW && lpszReturnW != szReturnW) if (lpszReturnW != szReturnW)
HeapFree(GetProcessHeap(), 0, lpszReturnW); HeapFree(GetProcessHeap(), 0, lpszReturnW);
} }
} }
if (lpszAssocW && lpszAssocW != szAssocW) if (lpszAssocW != szAssocW)
HeapFree(GetProcessHeap(), 0, lpszAssocW); HeapFree(GetProcessHeap(), 0, lpszAssocW);
if (lpszExtraW && lpszExtraW != szExtraW) if (lpszExtraW != szExtraW)
HeapFree(GetProcessHeap(), 0, lpszExtraW); HeapFree(GetProcessHeap(), 0, lpszExtraW);
return hRet; return hRet;
} }
...@@ -406,7 +406,7 @@ HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc ...@@ -406,7 +406,7 @@ HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc
} }
} }
if (lpszExtraW && lpszExtraW != szExtraW) if (lpszExtraW != szExtraW)
HeapFree(GetProcessHeap(), 0, lpszExtraW); HeapFree(GetProcessHeap(), 0, lpszExtraW);
return hRet; return hRet;
} }
......
...@@ -4157,7 +4157,7 @@ INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, ...@@ -4157,7 +4157,7 @@ INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan,
info->bmiHeader.biCompression = 0; info->bmiHeader.biCompression = 0;
} }
if(descr.colorMap && descr.colorMap != colorPtr) if(descr.colorMap != colorPtr)
HeapFree(GetProcessHeap(), 0, descr.colorMap); HeapFree(GetProcessHeap(), 0, descr.colorMap);
return lines; return lines;
} }
......
...@@ -81,7 +81,7 @@ LPCTSTR GetValueName(HWND hwndLV) ...@@ -81,7 +81,7 @@ LPCTSTR GetValueName(HWND hwndLV)
{ {
INT item; INT item;
if (g_valueName && g_valueName != LPSTR_TEXTCALLBACK) if (g_valueName != LPSTR_TEXTCALLBACK)
HeapFree(GetProcessHeap(), 0, g_valueName); HeapFree(GetProcessHeap(), 0, g_valueName);
g_valueName = NULL; g_valueName = NULL;
......
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