plug a potentially huge memory leak
This commit is contained in:
parent
dafbf72f7f
commit
34fcdda1e2
|
|
@ -7,6 +7,7 @@ Author: 1985 Thomas L. Quarles
|
|||
#include "vsrcdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
#include "ngspice/suffix.h"
|
||||
#include "ngspice/1-f-code.h"
|
||||
|
||||
|
||||
int
|
||||
|
|
@ -15,8 +16,10 @@ VSRCdelete(GENinstance *gen_inst)
|
|||
VSRCinstance *inst = (VSRCinstance *) gen_inst;
|
||||
|
||||
FREE(inst->VSRCcoeffs);
|
||||
|
||||
FREE(inst->VSRCtrnoise_state);
|
||||
if (inst->VSRCtrnoise_state) {
|
||||
FREE(inst->VSRCtrnoise_state->oneof);
|
||||
FREE(inst->VSRCtrnoise_state);
|
||||
}
|
||||
FREE(inst->VSRCtrrandom_state);
|
||||
|
||||
return OK;
|
||||
|
|
|
|||
Loading…
Reference in New Issue