From 410302d8987cb5f51dcf4ec2f57280ec41f303e8 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Sun, 21 Sep 2008 15:52:16 +0200 Subject: [PATCH] oleaut32: Remove redundant NULL check before SysFreeString. --- dlls/oleaut32/tmarshal.c | 6 ++--- dlls/oleaut32/typelib.c | 55 +++++++++++++--------------------------- 2 files changed, 20 insertions(+), 41 deletions(-) diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index fdfe07ce7c9..a7b40092a2f 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -1420,8 +1420,8 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) TRACE_(olerelay)("("); } - if (iname) SysFreeString(iname); - if (fname) SysFreeString(fname); + SysFreeString(iname); + SysFreeString(fname); memset(&buf,0,sizeof(buf)); @@ -2080,7 +2080,7 @@ TMStubImpl_Invoke( goto exit; } - if (iname) SysFreeString (iname); + SysFreeString (iname); /* Need them for hack below */ memset(names,0,sizeof(names)); diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index ceb229528b1..9539bd076c8 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -838,7 +838,7 @@ enddeleteloop: } end: - if (tlibPath) SysFreeString(tlibPath); + SysFreeString(tlibPath); if (typeLib) ITypeLib_Release(typeLib); if (subKey) RegCloseKey(subKey); if (key) RegCloseKey(key); @@ -3833,29 +3833,17 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) } TRACE(" destroying ITypeLib(%p)\n",This); - if (This->Name) - { - SysFreeString(This->Name); - This->Name = NULL; - } + SysFreeString(This->Name); + This->Name = NULL; - if (This->DocString) - { - SysFreeString(This->DocString); - This->DocString = NULL; - } + SysFreeString(This->DocString); + This->DocString = NULL; - if (This->HelpFile) - { - SysFreeString(This->HelpFile); - This->HelpFile = NULL; - } + SysFreeString(This->HelpFile); + This->HelpFile = NULL; - if (This->HelpStringDll) - { - SysFreeString(This->HelpStringDll); - This->HelpStringDll = NULL; - } + SysFreeString(This->HelpStringDll); + This->HelpStringDll = NULL; for (pCustData = This->pCustData; pCustData; pCustData = pCustDataNext) { @@ -4679,23 +4667,14 @@ static ULONG WINAPI ITypeInfo_fnRelease(ITypeInfo2 *iface) if (This->no_free_data) goto finish_free; - if (This->Name) - { - SysFreeString(This->Name); - This->Name = 0; - } + SysFreeString(This->Name); + This->Name = NULL; - if (This->DocString) - { - SysFreeString(This->DocString); - This->DocString = 0; - } + SysFreeString(This->DocString); + This->DocString = NULL; - if (This->DllName) - { - SysFreeString(This->DllName); - This->DllName = 0; - } + SysFreeString(This->DllName); + This->DllName = NULL; for (pFInfo = This->funclist; pFInfo; pFInfo = pFInfoNext) { @@ -6526,7 +6505,7 @@ static HRESULT WINAPI ITypeInfo_fnAddressOfMember( ITypeInfo2 *iface, { ERR("couldn't load %s\n", debugstr_w(dll)); SysFreeString(dll); - if (entry) SysFreeString(entry); + SysFreeString(entry); return STG_E_FILENOTFOUND; } /* FIXME: store library somewhere where we can free it */ @@ -6552,7 +6531,7 @@ static HRESULT WINAPI ITypeInfo_fnAddressOfMember( ITypeInfo2 *iface, } SysFreeString(dll); - if (entry) SysFreeString(entry); + SysFreeString(entry); if (!*ppv) return TYPE_E_DLLFUNCTIONNOTFOUND;