Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Use bmake_malloc where we don't test the return...
details: https://anonhg.NetBSD.org/src/rev/77b738e14348
branches: trunk
changeset: 352977:77b738e14348
user: maya <maya%NetBSD.org@localhost>
date: Sun Apr 16 20:00:58 2017 +0000
description:
Use bmake_malloc where we don't test the return value of malloc currently.
Appeases coverity.
diffstat:
usr.bin/make/main.c | 8 ++++----
usr.bin/make/parse.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diffs (71 lines):
diff -r 0c33677d03f3 -r 77b738e14348 usr.bin/make/main.c
--- a/usr.bin/make/main.c Sun Apr 16 19:53:58 2017 +0000
+++ b/usr.bin/make/main.c Sun Apr 16 20:00:58 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $ */
+/* $NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -81,7 +81,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $");
#endif
#endif /* not lint */
#endif
@@ -323,7 +323,7 @@
goto debug_setbuf;
}
len = strlen(modules);
- fname = malloc(len + 20);
+ fname = bmake_malloc(len + 20);
memcpy(fname, modules, len + 1);
/* Let the filename be modified by the pid */
if (strcmp(fname + len - 3, ".%d") == 0)
diff -r 0c33677d03f3 -r 77b738e14348 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c Sun Apr 16 19:53:58 2017 +0000
+++ b/usr.bin/make/parse.c Sun Apr 16 20:00:58 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $ */
+/* $NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya 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.219 2017/04/16 19:53:58 riastradh Exp $");
+__RCSID("$NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya Exp $");
#endif
#endif /* not lint */
#endif
@@ -527,7 +527,7 @@
if (lf->buf != MAP_FAILED) {
/* succeeded */
if (lf->len == lf->maplen && lf->buf[lf->len - 1] != '\n') {
- char *b = malloc(lf->len + 1);
+ char *b = bmake_malloc(lf->len + 1);
b[lf->len] = '\n';
memcpy(b, lf->buf, lf->len++);
munmap(lf->buf, lf->maplen);
Home |
Main Index |
Thread Index |
Old Index