hhctrl.ocx: Fix a memory leak on an error path (Smatch).

This commit is contained in:
Michael Stefaniuc 2009-07-02 00:32:31 +02:00 committed by Alexandre Julliard
parent a9f3bd06fd
commit d6eb5eb7c6
1 changed files with 3 additions and 1 deletions

View File

@ -370,8 +370,10 @@ CHMInfo *OpenCHM(LPCWSTR szFile)
if (!(ret = heap_alloc_zero(sizeof(CHMInfo))))
return NULL;
if (!(ret->szFile = strdupW(szFile)))
if (!(ret->szFile = strdupW(szFile))) {
heap_free(ret);
return NULL;
}
hres = CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER,
&IID_IITStorage, (void **) &ret->pITStorage) ;