Commit c9d80d60 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

use free()/malloc() instead of realloc()

When growing the audioOutput->convBuffer, we can use free()+malloc() instead of realloc(), which saves a memcpy(). git-svn-id: https://svn.musicpd.org/mpd/trunk@7295 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 1d18ca69
......@@ -189,8 +189,9 @@ static void convertAudioFormat(AudioOutput * audioOutput,
&(audioOutput->outAudioFormat));
if (size > audioOutput->convBufferLen) {
audioOutput->convBuffer =
xrealloc(audioOutput->convBuffer, size);
if (audioOutput->convBuffer != NULL)
free(audioOutput->convBuffer);
audioOutput->convBuffer = xmalloc(size);
audioOutput->convBufferLen = size;
}
......
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