In my EvtPrepareHardware I allocate a small buffer in NonPagedPool. In my EvtReleaseHardware I call ExFreePool to let it go. PREfast, though, says
that it is a memory leak. The pointer is being stored in the device context. Am I doing something wrong here?
I think that is a false positive.
/Faik
On Sun, Jan 16, 2011 at 9:19 PM, Michael Wade wrote:
> In my EvtPrepareHardware I allocate a small buffer in NonPagedPool. ?In my EvtReleaseHardware I call ExFreePool to let it go. ?PREfast, though, says
> that it is a memory leak. ?The pointer is being stored in the device context. ?Am I doing something wrong here?
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
In my EvtPrepareHardware I allocate a small buffer in NonPagedPool.
In my
EvtReleaseHardware I call ExFreePool to let it go. PREfast, though,
says
that it is a memory leak. The pointer is being stored in the device
context.
Am I doing something wrong here?
Are you definitely registering your Prepare and Release routines? Is
there any logic that would cause the ExFreePool not to be called (eg an
early exit in Release)?
James