changeset 458:69c8ba97f4bd

Fixed memory corruption when freeing DLS instruments
author hercules
date Sun, 05 Oct 2003 23:33:11 +0000
parents 9c12dc86d482
children 4d2febf33dc7
files decoders/timidity/instrum_dls.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/decoders/timidity/instrum_dls.c	Sun Oct 05 23:25:59 2003 +0000
+++ b/decoders/timidity/instrum_dls.c	Sun Oct 05 23:33:11 2003 +0000
@@ -78,10 +78,8 @@
     if ( chunk->child ) {
         FreeRIFFChunk(chunk->child);
     }
-    while ( chunk->next ) {
-        RIFF_Chunk *freeable = chunk->next;
-        chunk->next = freeable->next;
-        FreeRIFFChunk(freeable);
+    if ( chunk->next ) {
+        FreeRIFFChunk(chunk->next);
     }
     free(chunk);
 }