diff --git a/dlls/comctl32/dpa.c b/dlls/comctl32/dpa.c index 41fb799d176d..148d3f10a023 100644 --- a/dlls/comctl32/dpa.c +++ b/dlls/comctl32/dpa.c @@ -129,8 +129,10 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, PFNDPASTREAM loadProc, if (!hDpa) return E_OUTOFMEMORY; - if (!DPA_Grow (hDpa, streamData.dwItems)) + if (!DPA_Grow (hDpa, streamData.dwItems)) { + DPA_Destroy (hDpa); return E_OUTOFMEMORY; + } /* load data from the stream into the dpa */ ptr = hDpa->ptrs;