Hello Alistair,
Alexandre Julliard wrote:
Module: wine Branch: master Commit: 264be58812fedf9a066bac521f9fff5821759890 URL: http://source.winehq.org/git/wine.git/?a=commit;h=264be58812fedf9a066bac521f...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Tue Mar 25 14:19:10 2008 +1100
msxml3: Added support for SAXXMLReader.
Smatch is complaining about SAXXMLReader_create() loosing memory.
HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj) { saxreader *reader;
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
reader = HeapAlloc( GetProcessHeap(), 0, sizeof (*reader) ); if( !reader ) return E_OUTOFMEMORY;
reader->lpVtbl = &saxreader_vtbl; reader->ref = 1;
TRACE("returning iface %p\n", *ppObj); return S_OK; }
reader is a local variable with function scope. Stuff gets assigned to it but there is no usage of it nor is it "exported" aka made visible outside of the function. Is there something missing here?
bye michael
On Tue, Mar 25, 2008 at 3:36 PM, Michael Stefaniuc mstefani@redhat.com wrote:
Hello Alistair,
Alexandre Julliard wrote:
Module: wine Branch: master Commit: 264be58812fedf9a066bac521f9fff5821759890 URL: http://source.winehq.org/git/wine.git/?a=commit;h=264be58812fedf9a066bac521f...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Tue Mar 25 14:19:10 2008 +1100
msxml3: Added support for SAXXMLReader.
Smatch is complaining about SAXXMLReader_create() loosing memory.
HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj) { saxreader *reader;
TRACE("(%p,%p)\n", pUnkOuter, ppObj); reader = HeapAlloc( GetProcessHeap(), 0, sizeof (*reader) ); if( !reader ) return E_OUTOFMEMORY; reader->lpVtbl = &saxreader_vtbl; reader->ref = 1;
----------- added -----------
*ppObj = (LPVOID *)reader;
----------- end ------------
TRACE("returning iface %p\n", *ppObj); return S_OK;
}
reader is a local variable with function scope. Stuff gets assigned to it but there is no usage of it nor is it "exported" aka made visible outside of the function. Is there something missing here?
There should probably also be a check for NULL ppObj.
On Tue, Mar 25, 2008 at 1:44 PM, James Hawkins truiken@gmail.com wrote:
On Tue, Mar 25, 2008 at 3:36 PM, Michael Stefaniuc mstefani@redhat.com wrote:
Hello Alistair,
Alexandre Julliard wrote:
Module: wine Branch: master Commit: 264be58812fedf9a066bac521f9fff5821759890 URL: http://source.winehq.org/git/wine.git/?a=commit;h=264be58812fedf9a066bac521f...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Tue Mar 25 14:19:10 2008 +1100
msxml3: Added support for SAXXMLReader.
Smatch is complaining about SAXXMLReader_create() loosing memory.
HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj) { saxreader *reader;
TRACE("(%p,%p)\n", pUnkOuter, ppObj); reader = HeapAlloc( GetProcessHeap(), 0, sizeof (*reader) ); if( !reader ) return E_OUTOFMEMORY; reader->lpVtbl = &saxreader_vtbl; reader->ref = 1;
----------- added -----------
*ppObj = (LPVOID *)reader;
----------- end ------------
TRACE("returning iface %p\n", *ppObj); return S_OK;
}
reader is a local variable with function scope. Stuff gets assigned to it but there is no usage of it nor is it "exported" aka made visible outside of the function. Is there something missing here?
There should probably also be a check for NULL ppObj.
-- James Hawkins
BTW, on systems without libxml2-dev, saxreader.c does not compile.