Commit 269ce609 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

dsound: Use malloc and free instead of _recalloc.

The memory is completely overwritten a few lines later, so there is no reason to preserve its original contents. Furthermore, _recalloc will not be available if this DLL switches from ucrtbase to msvcrt, and the code as written would leak memory if _recalloc failed.
parent d5988259
...@@ -178,7 +178,8 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSou ...@@ -178,7 +178,8 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSou
if (howmuch > 0) { if (howmuch > 0) {
/* Make an internal copy of the caller-supplied array. /* Make an internal copy of the caller-supplied array.
* Replace the existing copy if one is already present. */ * Replace the existing copy if one is already present. */
This->notifies = _recalloc(This->notifies, howmuch, sizeof(DSBPOSITIONNOTIFY)); free(This->notifies);
This->notifies = malloc(howmuch * sizeof(DSBPOSITIONNOTIFY));
if (!This->notifies) { if (!This->notifies) {
WARN("out of memory\n"); WARN("out of memory\n");
return DSERR_OUTOFMEMORY; return DSERR_OUTOFMEMORY;
......
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