diff options
author | joerg <joerg> | 2008-08-02 20:33:50 +0000 |
---|---|---|
committer | joerg <joerg> | 2008-08-02 20:33:50 +0000 |
commit | 7be93b44a0d2e33aa0dd07de5f5b673bf95b27c8 (patch) | |
tree | 8901b5966bac844405a560018181d94cc4eccd35 /pkgtools/pkg_install/files/lib/lpkg.c | |
parent | f3a58140319f67643ea733850de213b695037b07 (diff) | |
download | pkgsrc-7be93b44a0d2e33aa0dd07de5f5b673bf95b27c8.tar.gz |
Most memory allocation failures were fatal already and the majority of
the rest lacked an explicit check. Add the usual x* wrappers around
malloc and friends that explicitly terminate on error and use them in
all but Dewey.
Diffstat (limited to 'pkgtools/pkg_install/files/lib/lpkg.c')
-rw-r--r-- | pkgtools/pkg_install/files/lib/lpkg.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pkgtools/pkg_install/files/lib/lpkg.c b/pkgtools/pkg_install/files/lib/lpkg.c index 58325d03568..09c079c62bb 100644 --- a/pkgtools/pkg_install/files/lib/lpkg.c +++ b/pkgtools/pkg_install/files/lib/lpkg.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpkg.c,v 1.5 2003/09/23 07:13:53 grant Exp $ */ +/* $NetBSD: lpkg.c,v 1.5.38.1 2008/08/02 20:33:50 joerg Exp $ */ /* * Copyright (c) 1999 Christian E. Hopps @@ -46,10 +46,8 @@ alloc_lpkg(const char *pkgname) { lpkg_t *lpp; - if ((lpp = malloc(sizeof(*lpp))) == 0) - err(EXIT_FAILURE, "cannot allocate recursion data"); - if ((lpp->lp_name = strdup(pkgname)) == 0) - err(EXIT_FAILURE, "cannot allocate recursion data"); + lpp = xmalloc(sizeof(*lpp)); + lpp->lp_name = xstrdup(pkgname); return (lpp); } |