Module Name: src Committed By: christos Date: Sun Jan 17 17:45:21 UTC 2016
Modified Files: src/usr.bin/make: arch.c compat.c cond.c job.c main.c make.c meta.c parse.c suff.c targ.c Log Message: remove free NULL checks (Tilman Sauerbeck) To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/usr.bin/make/arch.c cvs rdiff -u -r1.102 -r1.103 src/usr.bin/make/compat.c cvs rdiff -u -r1.72 -r1.73 src/usr.bin/make/cond.c cvs rdiff -u -r1.184 -r1.185 src/usr.bin/make/job.c cvs rdiff -u -r1.237 -r1.238 src/usr.bin/make/main.c cvs rdiff -u -r1.93 -r1.94 src/usr.bin/make/make.c cvs rdiff -u -r1.43 -r1.44 src/usr.bin/make/meta.c cvs rdiff -u -r1.208 -r1.209 src/usr.bin/make/parse.c cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/suff.c cvs rdiff -u -r1.60 -r1.61 src/usr.bin/make/targ.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/arch.c diff -u src/usr.bin/make/arch.c:1.66 src/usr.bin/make/arch.c:1.67 --- src/usr.bin/make/arch.c:1.66 Sun Jan 17 10:32:38 2016 +++ src/usr.bin/make/arch.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.66 2016/01/17 15:32:38 christos Exp $ */ +/* $NetBSD: arch.c,v 1.67 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.66 2016/01/17 15:32:38 christos Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.67 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.66 2016/01/17 15:32:38 christos Exp $"); +__RCSID("$NetBSD: arch.c,v 1.67 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -203,8 +203,7 @@ ArchFree(void *ap) free(Hash_GetValue(entry)); free(a->name); - if (a->fnametab) - free(a->fnametab); + free(a->fnametab); Hash_DeleteTable(&a->members); free(a); } @@ -261,8 +260,8 @@ Arch_ParseArchive(char **linePtr, Lst no char *result; result = Var_Parse(cp, ctxt, TRUE, TRUE, FALSE, &length, &freeIt); - if (freeIt) - free(freeIt); + free(freeIt); + if (result == var_Error) { return(FAILURE); } else { @@ -302,8 +301,8 @@ Arch_ParseArchive(char **linePtr, Lst no char *result; result = Var_Parse(cp, ctxt, TRUE, TRUE, FALSE, &length, &freeIt); - if (freeIt) - free(freeIt); + free(freeIt); + if (result == var_Error) { return(FAILURE); } else { @@ -710,8 +709,7 @@ ArchStatMember(char *archive, char *memb badarch: fclose(arch); Hash_DeleteTable(&ar->members); - if (ar->fnametab) - free(ar->fnametab); + free(ar->fnametab); free(ar); return NULL; } @@ -996,10 +994,10 @@ Arch_Touch(GNode *gn) arch = ArchFindMember(Var_Value(ARCHIVE, gn, &p1), Var_Value(MEMBER, gn, &p2), &arh, "r+"); - if (p1) - free(p1); - if (p2) - free(p2); + + free(p1); + free(p2); + snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now); if (arch != NULL) { @@ -1078,10 +1076,9 @@ Arch_MTime(GNode *gn) arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, &p1), Var_Value(MEMBER, gn, &p2), TRUE); - if (p1) - free(p1); - if (p2) - free(p2); + + free(p1); + free(p2); if (arhPtr != NULL) { modTime = (time_t)strtol(arhPtr->ar_date, NULL, 10); Index: src/usr.bin/make/compat.c diff -u src/usr.bin/make/compat.c:1.102 src/usr.bin/make/compat.c:1.103 --- src/usr.bin/make/compat.c:1.102 Fri Jan 8 19:55:17 2016 +++ src/usr.bin/make/compat.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.102 2016/01/09 00:55:17 christos Exp $ */ +/* $NetBSD: compat.c,v 1.103 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.102 2016/01/09 00:55:17 christos Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.103 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.102 2016/01/09 00:55:17 christos Exp $"); +__RCSID("$NetBSD: compat.c,v 1.103 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -143,8 +143,8 @@ CompatInterrupt(int signo) if (!noExecute && eunlink(file) != -1) { Error("*** %s removed", file); } - if (p1) - free(p1); + + free(p1); /* * Run .INTERRUPT only if hit with interrupt signal @@ -371,10 +371,10 @@ again: execError("exec", av[0]); _exit(1); } - if (mav) - free(mav); - if (bp) - free(bp); + + free(mav); + free(bp); + Lst_Replace(cmdNode, NULL); #ifdef USE_META @@ -513,8 +513,7 @@ Compat_Make(void *gnp, void *pgnp) if (Lst_Member(gn->iParents, pgn) != NULL) { char *p1; Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0); - if (p1) - free(p1); + free(p1); } /* @@ -617,8 +616,7 @@ Compat_Make(void *gnp, void *pgnp) if (Lst_Member(gn->iParents, pgn) != NULL) { char *p1; Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0); - if (p1) - free(p1); + free(p1); } switch(gn->made) { case BEINGMADE: Index: src/usr.bin/make/cond.c diff -u src/usr.bin/make/cond.c:1.72 src/usr.bin/make/cond.c:1.73 --- src/usr.bin/make/cond.c:1.72 Fri Jan 8 19:55:17 2016 +++ src/usr.bin/make/cond.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.72 2016/01/09 00:55:17 christos Exp $ */ +/* $NetBSD: cond.c,v 1.73 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.72 2016/01/09 00:55:17 christos Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.73 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.72 2016/01/09 00:55:17 christos Exp $"); +__RCSID("$NetBSD: cond.c,v 1.73 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -291,8 +291,7 @@ CondGetArg(char **linePtr, char **argPtr cp2 = Var_Parse(cp, VAR_CMD, TRUE, TRUE, FALSE, &len, &freeIt); Buf_AddBytes(&buf, strlen(cp2), cp2); - if (freeIt) - free(freeIt); + free(freeIt); cp += len; continue; } @@ -346,8 +345,8 @@ CondDoDefined(int argLen MAKE_ATTR_UNUSE } else { result = FALSE; } - if (p1) - free(p1); + + free(p1); return (result); } @@ -805,10 +804,8 @@ do_string_compare: } done: - if (lhsFree) - free(lhsFree); - if (rhsFree) - free(rhsFree); + free(lhsFree); + free(rhsFree); return t; } @@ -848,8 +845,7 @@ get_mpt_arg(char **linePtr, char **argPt * true/false here. */ length = *val ? 2 : 1; - if (freeIt) - free(freeIt); + free(freeIt); return length; } @@ -900,8 +896,7 @@ compare_function(Boolean doEval) } /* Evaluate the argument using the required function. */ t = !doEval || fn_def->fn_proc(arglen, arg); - if (arg) - free(arg); + free(arg); condExpr = cp; return t; } @@ -933,8 +928,7 @@ compare_function(Boolean doEval) * be empty - even if it contained a variable expansion. */ t = !doEval || if_info->defProc(arglen, arg) != if_info->doNot; - if (arg) - free(arg); + free(arg); return t; } Index: src/usr.bin/make/job.c diff -u src/usr.bin/make/job.c:1.184 src/usr.bin/make/job.c:1.185 --- src/usr.bin/make/job.c:1.184 Sun Jan 17 10:32:38 2016 +++ src/usr.bin/make/job.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.184 2016/01/17 15:32:38 christos Exp $ */ +/* $NetBSD: job.c,v 1.185 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.184 2016/01/17 15:32:38 christos Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.185 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.184 2016/01/17 15:32:38 christos Exp $"); +__RCSID("$NetBSD: job.c,v 1.185 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -852,8 +852,7 @@ JobPrintCommand(void *cmdp, void *jobp) DBPRINTF(cmdTemplate, cmd); free(cmdStart); - if (escCmd) - free(escCmd); + free(escCmd); if (errOff) { /* * If echoing is already off, there's no point in issuing the @@ -1219,8 +1218,7 @@ Job_CheckCommands(GNode *gn, void (*abor */ Make_HandleUse(DEFAULT, gn); Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn, 0); - if (p1) - free(p1); + free(p1); } else if (Dir_MTime(gn, 0) == 0 && (gn->type & OP_SPECIAL) == 0) { /* * The node wasn't the target of an operator we have no .DEFAULT @@ -2385,8 +2383,7 @@ Job_ParseShell(char *line) line++; } - if (shellArgv) - free(UNCONST(shellArgv)); + free(UNCONST(shellArgv)); memset(&newShell, 0, sizeof(newShell)); @@ -2634,8 +2631,7 @@ void Job_End(void) { #ifdef CLEANUP - if (shellArgv) - free(shellArgv); + free(shellArgv); #endif } Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.237 src/usr.bin/make/main.c:1.238 --- src/usr.bin/make/main.c:1.237 Sun Jan 17 10:32:38 2016 +++ src/usr.bin/make/main.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.237 2016/01/17 15:32:38 christos Exp $ */ +/* $NetBSD: main.c,v 1.238 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.237 2016/01/17 15:32:38 christos Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.238 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.237 2016/01/17 15:32:38 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.238 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -664,8 +664,7 @@ Main_ParseArgLine(const char *line) buf = bmake_malloc(len = strlen(line) + strlen(argv0) + 2); (void)snprintf(buf, len, "%s %s", argv0, line); - if (p1) - free(p1); + free(p1); argv = brk_string(buf, &argc, TRUE, &args); if (argv == NULL) { @@ -715,8 +714,7 @@ Main_SetObjdir(const char *path) } } - if (p) - free(p); + free(p); return rc; } @@ -787,8 +785,8 @@ MakeMode(const char *mode) meta_mode_init(mode); #endif } - if (mp) - free(mp); + + free(mp); } /*- @@ -1240,8 +1238,7 @@ main(int argc, char **argv) MakeMode(NULL); Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL); - if (p1) - free(p1); + free(p1); if (!compatMake) Job_ServerStart(maxJobTokens, jp_0, jp_1); @@ -1328,8 +1325,7 @@ main(int argc, char **argv) value = Var_Value(var, VAR_GLOBAL, &p1); } printf("%s\n", value ? value : ""); - if (p1) - free(p1); + free(p1); } } else { /* @@ -1453,8 +1449,7 @@ ReadMakefile(const void *p, const void * name = Dir_FindFile(fname, Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath); if (!name || (fd = open(name, O_RDONLY)) == -1) { - if (name) - free(name); + free(name); free(path); return(-1); } Index: src/usr.bin/make/make.c diff -u src/usr.bin/make/make.c:1.93 src/usr.bin/make/make.c:1.94 --- src/usr.bin/make/make.c:1.93 Fri Jan 8 19:55:17 2016 +++ src/usr.bin/make/make.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.93 2016/01/09 00:55:17 christos Exp $ */ +/* $NetBSD: make.c,v 1.94 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: make.c,v 1.93 2016/01/09 00:55:17 christos Exp $"; +static char rcsid[] = "$NetBSD: make.c,v 1.94 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: make.c,v 1.93 2016/01/09 00:55:17 christos Exp $"); +__RCSID("$NetBSD: make.c,v 1.94 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -482,8 +482,7 @@ Make_HandleUse(GNode *cgn, GNode *pgn) if (gn->uname == NULL) { gn->uname = gn->name; } else { - if (gn->name) - free(gn->name); + free(gn->name); } gn->name = Var_Subst(NULL, gn->uname, pgn, FALSE, TRUE, FALSE); if (gn->name && gn->uname && strcmp(gn->name, gn->uname) != 0) { @@ -692,8 +691,7 @@ Make_Update(GNode *cgn) checked++; cname = Var_Value(TARGET, cgn, &p1); - if (p1) - free(p1); + free(p1); if (DEBUG(MAKE)) fprintf(debug_file, "Make_Update: %s%s\n", cgn->name, cgn->cohort_num); @@ -838,8 +836,7 @@ Make_Update(GNode *cgn) Var_Set(PREFIX, cpref, pgn, 0); } } - if (p1) - free(p1); + free(p1); Lst_Close(cgn->iParents); } } @@ -907,8 +904,7 @@ MakeAddAllSrc(void *cgnp, void *pgnp) } if (allsrc != NULL) Var_Append(ALLSRC, allsrc, pgn); - if (p2) - free(p2); + free(p2); if (pgn->type & OP_JOIN) { if (cgn->made == MADE) { Var_Append(OODATE, child, pgn); @@ -934,8 +930,7 @@ MakeAddAllSrc(void *cgnp, void *pgnp) */ Var_Append(OODATE, child, pgn); } - if (p1) - free(p1); + free(p1); } return (0); } @@ -981,8 +976,7 @@ Make_DoAllVar(GNode *gn) if (gn->type & OP_JOIN) { char *p1; Var_Set(TARGET, Var_Value(ALLSRC, gn, &p1), gn, 0); - if (p1) - free(p1); + free(p1); } gn->flags |= DONE_ALLSRC; } Index: src/usr.bin/make/meta.c diff -u src/usr.bin/make/meta.c:1.43 src/usr.bin/make/meta.c:1.44 --- src/usr.bin/make/meta.c:1.43 Sun Jan 17 10:32:38 2016 +++ src/usr.bin/make/meta.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.43 2016/01/17 15:32:38 christos Exp $ */ +/* $NetBSD: meta.c,v 1.44 2016/01/17 17:45:21 christos Exp $ */ /* * Implement 'meta' mode. @@ -295,8 +295,7 @@ meta_name(struct GNode *gn, char *mname, } free(tp); for (i--; i >= 0; i--) { - if (p[i]) - free(p[i]); + free(p[i]); } return (mname); } @@ -348,8 +347,7 @@ is_submake(void *cmdp, void *gnp) } } } - if (mp) - free(mp); + free(mp); return (rc); } @@ -369,8 +367,7 @@ printCMD(void *cmdp, void *mfpp) cmd = cp = Var_Subst(NULL, cmd, mfp->gn, FALSE, TRUE); } fprintf(mfp->fp, "CMD %s\n", cmd); - if (cp) - free(cp); + free(cp); return 0; } @@ -519,8 +516,7 @@ meta_create(BuildMon *pbm, GNode *gn) } out: for (i--; i >= 0; i--) { - if (p[i]) - free(p[i]); + free(p[i]); } return (mf.fp); @@ -1030,14 +1026,12 @@ meta_oodate(GNode *gn, Boolean oodate) ldir = Var_Value(ldir_vname, VAR_GLOBAL, &tp); if (ldir) { strlcpy(latestdir, ldir, sizeof(latestdir)); - if (tp) - free(tp); + free(tp); } ldir = Var_Value(lcwd_vname, VAR_GLOBAL, &tp); if (ldir) { strlcpy(lcwd, ldir, sizeof(lcwd)); - if (tp) - free(tp); + free(tp); } } /* Skip past the pid. */ @@ -1394,8 +1388,7 @@ meta_oodate(GNode *gn, Boolean oodate) */ Var_Delete(OODATE, gn); Var_Set(OODATE, Var_Value(ALLSRC, gn, &cp), gn, 0); - if (cp) - free(cp); + free(cp); } return oodate; } Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.208 src/usr.bin/make/parse.c:1.209 --- src/usr.bin/make/parse.c:1.208 Sun Jan 17 10:32:38 2016 +++ src/usr.bin/make/parse.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.208 2016/01/17 15:32:38 christos Exp $ */ +/* $NetBSD: parse.c,v 1.209 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.208 2016/01/17 15:32:38 christos Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.209 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.208 2016/01/17 15:32:38 christos Exp $"); +__RCSID("$NetBSD: parse.c,v 1.209 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -1219,8 +1219,7 @@ ParseDoDependency(char *line) void *freeIt; (void)Var_Parse(cp, VAR_CMD, TRUE, TRUE, FALSE, &length, &freeIt); - if (freeIt) - free(freeIt); + free(freeIt); cp += length-1; } } @@ -2324,10 +2323,8 @@ ParseSetIncludedFile(void) fprintf(debug_file, "%s: ${.INCLUDEDFROMDIR} = `%s' " "${.INCLUDEDFROMFILE} = `%s'\n", __func__, pd, pf); - if (fp) - free(fp); - if (dp) - free(dp); + free(fp); + free(dp); } /*- *--------------------------------------------------------------------- Index: src/usr.bin/make/suff.c diff -u src/usr.bin/make/suff.c:1.76 src/usr.bin/make/suff.c:1.77 --- src/usr.bin/make/suff.c:1.76 Fri Jan 8 19:55:17 2016 +++ src/usr.bin/make/suff.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.76 2016/01/09 00:55:17 christos Exp $ */ +/* $NetBSD: suff.c,v 1.77 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.76 2016/01/09 00:55:17 christos Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.77 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.76 2016/01/09 00:55:17 christos Exp $"); +__RCSID("$NetBSD: suff.c,v 1.77 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -1614,8 +1614,7 @@ SuffExpandChildren(LstNode cln, GNode *p cp += len - 1; } - if (freeIt) - free(freeIt); + free(freeIt); } else if (*cp == '\\' && *cp != '\0') { /* * Escaped something -- skip over it @@ -1933,8 +1932,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, 0); - if (p1) - free(p1); + free(p1); } Index: src/usr.bin/make/targ.c diff -u src/usr.bin/make/targ.c:1.60 src/usr.bin/make/targ.c:1.61 --- src/usr.bin/make/targ.c:1.60 Mon May 25 05:01:06 2015 +++ src/usr.bin/make/targ.c Sun Jan 17 12:45:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $ */ +/* $NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $"; +static char rcsid[] = "$NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $"); +__RCSID("$NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $"); #endif #endif /* not lint */ #endif @@ -292,10 +292,8 @@ TargFreeGN(void *gnp) free(gn->name); - if (gn->uname) - free(gn->uname); - if (gn->path) - free(gn->path); + free(gn->uname); + free(gn->path); /* gn->fname points to name allocated when file was opened, don't free */ Lst_Destroy(gn->iParents, NULL);