ole32: Print error message when IPersistStorage_Load fails (Coverity)

Huw Davies huw at codeweavers.com
Wed Dec 23 04:37:00 CST 2015


On Tue, Dec 22, 2015 at 07:35:08PM +0100, André Hentschel wrote:
> Signed-off-by: André Hentschel <nerv at dawncrow.de>
> ---
> CID 1336207
> 
>  dlls/ole32/compobj.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
> index 2f55076..b146376 100644
> --- a/dlls/ole32/compobj.c
> +++ b/dlls/ole32/compobj.c
> @@ -3443,7 +3443,9 @@ HRESULT WINAPI CoGetInstanceFromIStorage(
>  
>    if (ps)
>    {
> -      IPersistStorage_Load(ps, storage);
> +      hr = IPersistStorage_Load(ps, storage);
> +      if (FAILED(hr))
> +          ERR("failed to load storage\n");
>        IPersistStorage_Release(ps);
>    }

I suspect Coverity is expecting us to do something
more useful with the return value ;-)

How about returning the failure in this case (obviously having
released ps first)?  Also, just above this hunk, we should probably
just return if QI fails.

While you're at it, there are other CoCreateInstanceFrom*
functions that could do with similar love.

Huw.



More information about the wine-devel mailing list