*** empty log message ***

This commit is contained in:
h_vogt 2009-04-05 12:26:19 +00:00
parent 8a4b560324
commit faada68e9d
4 changed files with 34 additions and 10 deletions

View File

@ -3,6 +3,7 @@
plotit.c, inpgtok.c:
some more memory leaks removed
spicenum.c: release of memory for dico->dyncategory corrected
subckt.c, inp.c, inpcom.c more on memory leaks
2009-04-01 Dietmar Warning
* frontend/resource.c, misc/misc_time.c: init of rusage structure to prevent

View File

@ -55,7 +55,8 @@ $Id$
/* static declarations */
static char * upper(register char *string);
static bool doedit(char *filename);
static void line_free_x(struct line * deck, bool recurse);
void line_free_x(struct line * deck, bool recurse);
/* uncomment this line for getting deck output after all
@ -302,7 +303,7 @@ top2:
* All lines linked via the li_actual field are always recursivly freed.
* SJB - 22nd May 2001
*/
static void
void
line_free_x(struct line * deck, bool recurse) {
if(!deck)
return;
@ -394,7 +395,9 @@ inp_spsource(FILE *fp, bool comfile, char *filename)
cp_evloop(dd->li_line);
}
}
/* free the control deck */
line_free(deck,TRUE);
/* printf("Command deck freed\n"); */
} /* end if(comfile) */
else { /* must be regular deck . . . . */
@ -614,7 +617,8 @@ inp_spsource(FILE *fp, bool comfile, char *filename)
}
#endif
line_free(deck, TRUE);
/* line_free(deck, TRUE); // have to keep this to allow listing
printf("Real deck freed\n"); */
/* Now that the deck is loaded, do the commands, if there are any */
if (controls) {

View File

@ -1119,11 +1119,10 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name)
s = copys; /* reuse s, but remember, buffer still points to allocated memory */
}
}
/* lower case the file name for later string compares */
s_ptr = strdup(s);
s_lower = strdup(s);
for(s_ptr = s_lower; *s_ptr && (*s_ptr != '\n'); s_ptr++) *s_ptr = tolower(*s_ptr);
/* lower case the file name for later string compares */
/* s_ptr = strdup(s); */
s_lower = strdup(s);
for(s_ptr = s_lower; *s_ptr && (*s_ptr != '\n'); s_ptr++) *s_ptr = tolower(*s_ptr);
found_library = FALSE;
for ( i = 0; i < num_libraries; i++ ) {

View File

@ -63,6 +63,9 @@ $Id$
#include "numparam/numpaif.h"
extern void line_free_x(struct line * deck, bool recurse);
#define line_free(line,flag) { line_free_x(line,flag); line = NULL; }
/* ----- static declarations ----- */
static struct line * doit(struct line *deck);
static int translate(struct line *deck, char *formal, char *actual, char *scname,
@ -365,7 +368,7 @@ doit(struct line *deck)
{
struct line *c, *last, *lc, *lcc;
struct line *savenext;
struct subs *sss = (struct subs *) NULL, *ks; /* *sss and *ks temporarily hold decks to substitute */
struct subs *sssfree, *sss = (struct subs *) NULL, *ks; /* *sss and *ks temporarily hold decks to substitute */
char *s, *t, *scname, *subname;
int nest, numpasses = MAXNEST, i;
bool gotone;
@ -427,7 +430,7 @@ doit(struct line *deck)
}
sss = alloc(struct subs);
sssfree = sss = alloc(struct subs);
if (!lcc) /* if lcc is null, then no .ends was found. */
lcc = last;
if ( use_numparams==FALSE )
@ -626,6 +629,23 @@ doit(struct line *deck)
subs = ts;
modnames = tmodnames;
submod = tsubmod;
/*
struct subs {
char *su_name;
char *su_args;
int su_numargs;
struct line *su_def;
struct subs *su_next;
} ;
*/
while(sssfree) {
struct subs *sss2 = sssfree;
sssfree = sssfree->su_next;
tfree(sss2->su_name);
tfree(sss2->su_args);
line_free(sss2->su_def, TRUE);
tfree(sss2);
}
return (deck);
}