Re: quartz: Use proper alloc/free functions for COM objects
On Do, 2007-03-08 at 03:06 -0800, Chris Robinson wrote:
Subject: [PATCH] quartz: Use proper alloc/free functions for COM objects
+ omr->messages = CoTaskMemAlloc(omr->ring_buffer_size * sizeof(Event)); + ZeroMemory(omr->messages, omr->ring_buffer_size * sizeof(Event));
+ fimpl = CoTaskMemAlloc(sizeof(*fimpl)); fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
+ This->ppPins = CoTaskMemAlloc((This->cStreams + 2) * sizeof(IPin *)); memcpy(This->ppPins, ppOldPins, (This->cStreams + 1) * sizeof(IPin *));
+ This->ppPins = CoTaskMemAlloc(sizeof(IPin *) * 1); memcpy(This->ppPins, ppOldPins, sizeof(IPin *) * 1);
While reading your Patch, I see the above Places, where the result from the allocation is used without a NULL-check. The other allocations are checked for NULL before used. Is this correct? -- By by ... Detlef
On Thursday 08 March 2007 08:14:54 am you wrote:
While reading your Patch, I see the above Places, where the result from the allocation is used without a NULL-check. The other allocations are checked for NULL before used.
Is this correct?
It should NULL check, but I was mainly concerned with just using/matching the right allocator functions (HeapAlloc is failable just like CoTaskMemAlloc, and if there wasn't a NULL check before, there isn't now). I can make in another patch to add missing NULL checks, though.
participants (2)
-
Chris Robinson -
Detlef Riekenberg