comparison decoders/timidity/timidity.c @ 411:1ba14a084531

Memory leak patched by Torbj�rn Andersson.
author Ryan C. Gordon <icculus@icculus.org>
date Sat, 17 Aug 2002 13:27:39 +0000
parents 3da217bd0e48
children cbc2a4ffeeec
comparison
equal deleted inserted replaced
410:ede9429ea6f5 411:1ba14a084531
304 name, line)); 304 name, line));
305 return -2; 305 return -2;
306 } 306 }
307 if (bank->tone[i].name) 307 if (bank->tone[i].name)
308 free(bank->tone[i].name); 308 free(bank->tone[i].name);
309 {
310 printf("alloc name\n");
311 strcpy((bank->tone[i].name=safe_malloc(strlen(w[1])+1)),w[1]); 309 strcpy((bank->tone[i].name=safe_malloc(strlen(w[1])+1)),w[1]);
312 }
313 bank->tone[i].note=bank->tone[i].amp=bank->tone[i].pan= 310 bank->tone[i].note=bank->tone[i].amp=bank->tone[i].pan=
314 bank->tone[i].strip_loop=bank->tone[i].strip_envelope= 311 bank->tone[i].strip_loop=bank->tone[i].strip_envelope=
315 bank->tone[i].strip_tail=-1; 312 bank->tone[i].strip_tail=-1;
316 313
317 for (j=2; j<words; j++) 314 for (j=2; j<words; j++)
572 } 569 }
573 free(master_tonebank[i]); 570 free(master_tonebank[i]);
574 } 571 }
575 if (master_drumset[i]) 572 if (master_drumset[i])
576 { 573 {
577 free(master_drumset[i]->tone); 574 ToneBankElement *e = master_drumset[i]->tone;
575 if (e != NULL)
576 {
577 for (j = 0; j < 128; j++)
578 {
579 if (e[j].name != NULL)
580 free(e[j].name);
581 }
582 free(e);
583 }
578 free(master_drumset[i]); 584 free(master_drumset[i]);
579 } 585 }
580 } 586 }
581 587
582 free_pathlist(); 588 free_pathlist();