From dba0fe3614b2bf8002551a7636cc90c7315e2c8d Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 16 Feb 2015 11:30:11 +0300 Subject: [PATCH] vbscript: Fix potential crash if script site creation failed. --- dlls/vbscript/global.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 77fc1d62ce7..448b886cf98 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -209,11 +209,12 @@ static HRESULT set_object_site(script_ctx_t *ctx, IUnknown *obj) return S_OK; ax_site = create_ax_site(ctx); - if(ax_site) + if(ax_site) { hres = IObjectWithSite_SetSite(obj_site, ax_site); + IUnknown_Release(ax_site); + } else hres = E_OUTOFMEMORY; - IUnknown_Release(ax_site); IObjectWithSite_Release(obj_site); return hres; }