diff decoders/timidity/instrum_dls.c @ 458:69c8ba97f4bd

Fixed memory corruption when freeing DLS instruments
author hercules
date Sun, 05 Oct 2003 23:33:11 +0000
parents cbc2a4ffeeec
children 4d2febf33dc7
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);
 }