mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-09-06 20:46:42 +02:00
Fix a memory leak reported by Brian Taylor that was introduced
by commit 4d8e17487b.
This commit is contained in:
committed by
Holger Vogt
parent
82de3db8ad
commit
98333ee89a
@@ -43,6 +43,7 @@ NON-STANDARD FEATURES
|
||||
|
||||
#include "ngspice/mifproto.h"
|
||||
#include "ngspice/mifdefs.h"
|
||||
#include "ngspice/evt.h"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#include "ngspice/mifparse.h"
|
||||
@@ -134,8 +135,16 @@ MIFdelete(GENinstance *gen_inst)
|
||||
/* Free the basic port structure allocated in MIFget_port */
|
||||
num_port = here->conn[i]->size;
|
||||
for (j = 0; j < num_port; j++) {
|
||||
/* Memory allocated in mif_inp2.c */
|
||||
Evt_Output_Event_t *evt;
|
||||
|
||||
/* Memory allocated in mif_inp2.c and evtload.c. */
|
||||
|
||||
FREE(here->conn[i]->port[j]->type_str);
|
||||
evt = here->conn[i]->port[j]->next_event;
|
||||
if (evt) {
|
||||
FREE(evt->value);
|
||||
FREE(evt);
|
||||
}
|
||||
FREE(here->conn[i]->port[j]);
|
||||
}
|
||||
FREE(here->conn[i]->port);
|
||||
|
||||
Reference in New Issue
Block a user