diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c
index c0333cab858..01cc8405f87 100644
--- a/dlls/mshtml/htmlimg.c
+++ b/dlls/mshtml/htmlimg.c
@@ -855,8 +855,10 @@ static ULONG WINAPI HTMLImageElementFactory_Release(IHTMLImageElementFactory *if
TRACE("(%p) ref=%ld\n", This, ref);
- if(!ref)
+ if(!ref) {
+ release_dispex(&This->dispex);
free(This);
+ }
return ref;
}