summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install/files/admin
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/pkg_install/files/admin')
-rw-r--r--pkgtools/pkg_install/files/admin/audit.c11
-rw-r--r--pkgtools/pkg_install/files/admin/check.c7
-rw-r--r--pkgtools/pkg_install/files/admin/main.c9
3 files changed, 11 insertions, 16 deletions
diff --git a/pkgtools/pkg_install/files/admin/audit.c b/pkgtools/pkg_install/files/admin/audit.c
index 1c9fb888dcd..2243686689f 100644
--- a/pkgtools/pkg_install/files/admin/audit.c
+++ b/pkgtools/pkg_install/files/admin/audit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: audit.c,v 1.8.2.2 2008/07/27 16:22:53 joerg Exp $ */
+/* $NetBSD: audit.c,v 1.8.2.3 2008/08/02 20:33:50 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -8,7 +8,7 @@
#include <sys/cdefs.h>
#endif
#ifndef lint
-__RCSID("$NetBSD: audit.c,v 1.8.2.2 2008/07/27 16:22:53 joerg Exp $");
+__RCSID("$NetBSD: audit.c,v 1.8.2.3 2008/08/02 20:33:50 joerg Exp $");
#endif
/*-
@@ -363,8 +363,7 @@ fetch_pkg_vulnerabilities(int argc, char **argv)
err(EXIT_FAILURE, "pkg-vulnerabilities is too large");
buf_len = st.size;
- if ((buf = malloc(buf_len + 1)) == NULL)
- err(EXIT_FAILURE, "malloc failed");
+ buf = xmalloc(buf_len + 1);
if (fetchIO_read(f, buf, buf_len) != buf_len)
err(EXIT_FAILURE, "Failure during fetch of pkg-vulnerabilities");
@@ -455,9 +454,7 @@ check_pkg_history1(const char *pkg, const char *pattern)
open_brace = inner_brace;
}
- expanded_pkg = malloc(strlen(pattern)); /* {} are going away... */
- if (expanded_pkg == NULL)
- err(EXIT_FAILURE, "malloc failed");
+ expanded_pkg = xmalloc(strlen(pattern)); /* {} are going away... */
prefix_len = open_brace - pattern;
suffix = close_brace + 1;
diff --git a/pkgtools/pkg_install/files/admin/check.c b/pkgtools/pkg_install/files/admin/check.c
index 07ee2b84c39..d2b835f6c4e 100644
--- a/pkgtools/pkg_install/files/admin/check.c
+++ b/pkgtools/pkg_install/files/admin/check.c
@@ -1,4 +1,4 @@
-/* $NetBSD: check.c,v 1.2.4.2 2008/05/23 15:57:04 joerg Exp $ */
+/* $NetBSD: check.c,v 1.2.4.3 2008/08/02 20:33:50 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -8,7 +8,7 @@
#include <sys/cdefs.h>
#endif
#ifndef lint
-__RCSID("$NetBSD: check.c,v 1.2.4.2 2008/05/23 15:57:04 joerg Exp $");
+__RCSID("$NetBSD: check.c,v 1.2.4.3 2008/08/02 20:33:50 joerg Exp $");
#endif
/*-
@@ -234,8 +234,7 @@ check_pkg(const char *pkg, int *filecnt, int *pkgcnt, int allow_unmatched)
errx(EXIT_FAILURE, "No matching pkg for %s.", pkg);
}
- if (asprintf(&pattern, "%s-[0-9]*", pkg) == -1)
- errx(EXIT_FAILURE, "asprintf failed");
+ pattern = xasprintf("%s-[0-9]*", pkg);
if (match_installed_pkgs(pattern, checkpattern_fn, &arg) == -1)
errx(EXIT_FAILURE, "Cannot process pkdbdb");
diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c
index 515795a7926..19cb7bfc8d6 100644
--- a/pkgtools/pkg_install/files/admin/main.c
+++ b/pkgtools/pkg_install/files/admin/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.42.2.5 2008/06/04 11:23:13 joerg Exp $ */
+/* $NetBSD: main.c,v 1.42.2.6 2008/08/02 20:33:50 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -8,7 +8,7 @@
#include <sys/cdefs.h>
#endif
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.42.2.5 2008/06/04 11:23:13 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.42.2.6 2008/08/02 20:33:50 joerg Exp $");
#endif
/*-
@@ -660,7 +660,7 @@ set_unset_variable(char **argv, Boolean unset)
if ((eq=strchr(argv[0], '=')) == NULL)
usage();
- variable = malloc(eq-argv[0]+1);
+ variable = xmalloc(eq-argv[0]+1);
strlcpy(variable, argv[0], eq-argv[0]+1);
arg.variable = variable;
@@ -692,8 +692,7 @@ set_unset_variable(char **argv, Boolean unset)
warnx("no matching pkg for `%s'", *argv);
ret++;
} else {
- if (asprintf(&pattern, "%s-[0-9]*", *argv) == -1)
- errx(EXIT_FAILURE, "asprintf failed");
+ pattern = xasprintf("%s-[0-9]*", *argv);
if (match_installed_pkgs(pattern, set_installed_info_var, &arg) == -1)
errx(EXIT_FAILURE, "Cannot process pkdbdb");