Commit ca1d074c authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

dsound: Replace a realloc-or-alloc with a free-then-alloc.

The buffer is to be overwritten anyway, so there's no need to preserve its contents. Also, the old code leaked if the realloc were to fail. All in all, free-then-alloc is simpler.
parent ad1090c2
......@@ -117,10 +117,7 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(
} else if (howmuch > 0) {
/* Make an internal copy of the caller-supplied array.
* Replace the existing copy if one is already present. */
if (This->dsb->notifies)
This->dsb->notifies = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
This->dsb->notifies, howmuch * sizeof(DSBPOSITIONNOTIFY));
else
HeapFree(GetProcessHeap(), 0, This->dsb->notifies);
This->dsb->notifies = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
howmuch * sizeof(DSBPOSITIONNOTIFY));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment