mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Remove efree(), it isn't used consistently enough to even pretend that it
might help on the systems it could possibly be used as a bandaid for. In fact, the only thing it's useful for is instrumenting free(3) calls, and in that capacity, it's better served as a local patch, than a public wrapper.
This commit is contained in:
parent
97490f4b3c
commit
cbfcb39874
10 changed files with 24 additions and 27 deletions
|
|
@ -149,7 +149,7 @@ ArchFree(void *ap)
|
|||
free(Hash_GetValue(entry));
|
||||
|
||||
free(a->name);
|
||||
efree(a->fnametab);
|
||||
free(a->fnametab);
|
||||
Hash_DeleteTable(&a->members);
|
||||
free(a);
|
||||
}
|
||||
|
|
@ -650,7 +650,7 @@ ArchStatMember (char *archive, char *member, Boolean hash)
|
|||
badarch:
|
||||
fclose (arch);
|
||||
Hash_DeleteTable (&ar->members);
|
||||
efree(ar->fnametab);
|
||||
free(ar->fnametab);
|
||||
free (ar);
|
||||
return (NULL);
|
||||
}
|
||||
|
|
@ -915,8 +915,8 @@ Arch_Touch (GNode *gn)
|
|||
arch = ArchFindMember(Var_Value (ARCHIVE, gn, &p1),
|
||||
Var_Value (TARGET, gn, &p2),
|
||||
&arh, "r+");
|
||||
efree(p1);
|
||||
efree(p2);
|
||||
free(p1);
|
||||
free(p2);
|
||||
snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now);
|
||||
|
||||
if (arch != NULL) {
|
||||
|
|
@ -986,8 +986,8 @@ Arch_MTime(GNode *gn)
|
|||
arhPtr = ArchStatMember (Var_Value (ARCHIVE, gn, &p1),
|
||||
Var_Value (TARGET, gn, &p2),
|
||||
TRUE);
|
||||
efree(p1);
|
||||
efree(p2);
|
||||
free(p1);
|
||||
free(p2);
|
||||
|
||||
if (arhPtr != NULL) {
|
||||
modTime = (int) strtol(arhPtr->ar_date, NULL, 10);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ CompatInterrupt (int signo)
|
|||
if (!noExecute && eunlink(file) != -1) {
|
||||
printf ("*** %s removed\n", file);
|
||||
}
|
||||
efree(p1);
|
||||
free(p1);
|
||||
|
||||
/*
|
||||
* Run .INTERRUPT only if hit with interrupt signal
|
||||
|
|
@ -435,7 +435,7 @@ CompatMake (void *gnp, void *pgnp)
|
|||
if (Lst_Member (gn->iParents, pgn) != NULL) {
|
||||
char *p1;
|
||||
Var_Set (IMPSRC, Var_Value(TARGET, gn, &p1), pgn);
|
||||
efree(p1);
|
||||
free(p1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -569,7 +569,7 @@ CompatMake (void *gnp, void *pgnp)
|
|||
char *p1;
|
||||
|
||||
printf ("\n\nStop in %s.\n", Var_Value(".CURDIR", gn, &p1));
|
||||
efree(p1);
|
||||
free(p1);
|
||||
exit (1);
|
||||
}
|
||||
} else if (gn->made == ERROR) {
|
||||
|
|
@ -582,7 +582,7 @@ CompatMake (void *gnp, void *pgnp)
|
|||
if (Lst_Member (gn->iParents, pgn) != NULL) {
|
||||
char *p1;
|
||||
Var_Set (IMPSRC, Var_Value(TARGET, gn, &p1), pgn);
|
||||
efree(p1);
|
||||
free(p1);
|
||||
}
|
||||
switch(gn->made) {
|
||||
case BEINGMADE:
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ CondDoDefined (int argLen, char *arg)
|
|||
} else {
|
||||
result = FALSE;
|
||||
}
|
||||
efree(p1);
|
||||
free(p1);
|
||||
arg[argLen] = savec;
|
||||
return (result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1070,7 +1070,7 @@ Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...))
|
|||
*/
|
||||
Make_HandleUse(DEFAULT, gn);
|
||||
Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn);
|
||||
efree(p1);
|
||||
free(p1);
|
||||
} else if (Dir_MTime(gn) == 0) {
|
||||
/*
|
||||
* The node wasn't the target of an operator we have no .DEFAULT
|
||||
|
|
|
|||
|
|
@ -759,7 +759,7 @@ main(int argc, char **argv)
|
|||
(void)ReadMakefile(".depend", NULL);
|
||||
|
||||
Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL);
|
||||
efree(p1);
|
||||
free(p1);
|
||||
|
||||
/* Install all the flags into the MAKE envariable. */
|
||||
if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1)) != NULL) && *p)
|
||||
|
|
@ -768,7 +768,7 @@ main(int argc, char **argv)
|
|||
#else
|
||||
setenv("MAKE", p, 1);
|
||||
#endif
|
||||
efree(p1);
|
||||
free(p1);
|
||||
|
||||
/*
|
||||
* For compatibility, look at the directories in the VPATH variable
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ Make_Update (GNode *cgn)
|
|||
char *p1;
|
||||
|
||||
cname = Var_Value (TARGET, cgn, &p1);
|
||||
efree(p1);
|
||||
free(p1);
|
||||
|
||||
/*
|
||||
* If the child was actually made, see what its modification time is
|
||||
|
|
@ -502,7 +502,7 @@ Make_Update (GNode *cgn)
|
|||
Var_Set (PREFIX, cpref, pgn);
|
||||
}
|
||||
}
|
||||
efree(ptr);
|
||||
free(ptr);
|
||||
Lst_Close (cgn->iParents);
|
||||
}
|
||||
}
|
||||
|
|
@ -570,7 +570,7 @@ MakeAddAllSrc (void *cgnp, void *pgnp)
|
|||
*/
|
||||
Var_Append(OODATE, child, pgn);
|
||||
}
|
||||
efree(p1);
|
||||
free(p1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
|
@ -612,7 +612,7 @@ Make_DoAllVar (GNode *gn)
|
|||
if (gn->type & OP_JOIN) {
|
||||
char *p1;
|
||||
Var_Set (TARGET, Var_Value (ALLSRC, gn, &p1), gn);
|
||||
efree(p1);
|
||||
free(p1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,9 +73,6 @@ int PrintAddr(void *, void *);
|
|||
void Finish(int);
|
||||
char *estrdup(const char *);
|
||||
void *emalloc(size_t);
|
||||
/* efree(x) works when x==NULL. STDC behavior, may need some different
|
||||
* definition for cross-builds on deficient systems */
|
||||
#define efree free
|
||||
void *erealloc(void *, size_t);
|
||||
void enomem(void);
|
||||
int eunlink(const char *);
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ str_concat(char *s1, char *s2, int flags)
|
|||
|
||||
/* free original strings */
|
||||
if (flags & STR_DOFREE) {
|
||||
(void)efree(s1);
|
||||
(void)efree(s2);
|
||||
(void)free(s1);
|
||||
(void)free(s2);
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1633,7 +1633,7 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
|
|||
for (i = (sizeof(copy)/sizeof(copy[0]))-1; i >= 0; i--) {
|
||||
char *p1;
|
||||
Var_Set(copy[i], Var_Value(copy[i], mem, &p1), gn);
|
||||
efree(p1);
|
||||
free(p1);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1955,7 +1955,7 @@ sfnd_abort:
|
|||
gn->suffix = (targ == NULL) ? NULL : targ->suff;
|
||||
if (gn->suffix)
|
||||
gn->suffix->refCount++;
|
||||
efree(gn->path);
|
||||
free(gn->path);
|
||||
gn->path = estrdup(gn->name);
|
||||
}
|
||||
|
||||
|
|
@ -2055,7 +2055,7 @@ sfnd_abort:
|
|||
/*
|
||||
* So Dir_MTime doesn't go questing for it...
|
||||
*/
|
||||
efree(gn->path);
|
||||
free(gn->path);
|
||||
gn->path = estrdup(gn->name);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ TargFreeGN (void *gnp)
|
|||
|
||||
|
||||
free(gn->name);
|
||||
efree(gn->path);
|
||||
free(gn->path);
|
||||
|
||||
Lst_Destroy(gn->iParents, NOFREE);
|
||||
Lst_Destroy(gn->cohorts, NOFREE);
|
||||
|
|
|
|||
Loading…
Reference in a new issue