[wdmaudiodev] Re: Bug in MSVAD sample, or misunderstanding?

  • From: Chun-Yu <cshei@xxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Sat, 5 Oct 2002 17:55:09 -0500 (EST)

Ah, but from the MSDN Library - "If memblock is NULL, the pointer is
ignored and free immediately returns."

So it doesn't hurt to call free on a NULL pointer - it just won't do
anything.

Chun-Yu

On Sat, 5 Oct 2002, Chris Edgington wrote:

> 
> In the msvad sample in the XP DDK, in basedma.cpp, the following code
> exists for the FreeBuffer method:
> 
>     if ( m_pvDmaBuffer )
>     {
>         ExFreePool( m_pvDmaBuffer );
>         m_ulDmaBufferSize = 0;
>     }
> 
> Am I missing something, or should m_pvDmaBuffer be set to NULL after the
> free? This has the potential of being called to free a NULL pointer,
> right?
> 
> Thanks,
> -Chris
> 
> ******************
> 
> WDMAUDIODEV addresses:
> Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
> Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
> Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
> Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx
> 
> URL to WDMAUDIODEV page:
> http://www.wdmaudiodev.de/
> 
> 
> 

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/

Other related posts: