Browse Source

vsrcdest.c, isrcdest.c: fix memory leak by freeing VSRCcoeffs, ISRCcoeffs

pre-master-46
h_vogt 13 years ago
committed by rlar
parent
commit
a97b330965
  1. 5
      src/spicelib/devices/isrc/isrcdest.c
  2. 5
      src/spicelib/devices/vsrc/vsrcdest.c

5
src/spicelib/devices/isrc/isrcdest.c

@ -24,7 +24,10 @@ ISRCdestroy(GENmodel **inModel)
oldmod = mod;
prev = NULL;
for(here = mod->ISRCinstances ; here ; here = here->ISRCnextInstance) {
if(prev) FREE(prev);
if(prev) {
tfree(prev->ISRCcoeffs);
FREE(prev);
}
prev = here;
}
if(prev) FREE(prev);

5
src/spicelib/devices/vsrc/vsrcdest.c

@ -24,7 +24,10 @@ VSRCdestroy(GENmodel **inModel)
oldmod = mod;
prev = NULL;
for(here = mod->VSRCinstances ; here ; here = here->VSRCnextInstance) {
if(prev) FREE(prev);
if(prev) {
tfree(prev->VSRCcoeffs);
FREE(prev);
}
prev = here;
}
if(prev) FREE(prev);

Loading…
Cancel
Save