diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2016-09-17 09:34:58 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2016-09-17 09:34:58 +0000 |
commit | c24e6b2049a042dbffd9566620b72b8ddd42fe8a (patch) | |
tree | 786c78375e5f66feaae3e2a1a70f9fbba610a921 /sbin | |
parent | aefc2a59872e903a3644836c009ccd5e1ecf2414 (diff) |
malloc sets errno; use err not errx
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ping/ping.c | 4 | ||||
-rw-r--r-- | sbin/ping6/ping6.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index a520e6402e2..11435e2f65e 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.200 2016/09/17 09:34:03 florian Exp $ */ +/* $OpenBSD: ping.c,v 1.201 2016/09/17 09:34:57 florian Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -423,7 +423,7 @@ main(int argc, char *argv[]) hostname = res->ai_canonname ? strdup(res->ai_canonname) : target; if (!hostname) - errx(1, "malloc"); + err(1, "malloc"); } if (res->ai_next) { diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index fe105c29a6c..5d61b596477 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping6.c,v 1.216 2016/09/17 09:34:28 florian Exp $ */ +/* $OpenBSD: ping6.c,v 1.217 2016/09/17 09:34:57 florian Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -372,7 +372,7 @@ main(int argc, char *argv[]) if (inet_aton(*argv, &dst4.sin_addr) != 0) { hostname = *argv; if ((target = strdup(inet_ntoa(dst4.sin_addr))) == NULL) - errx(1, "malloc"); + err(1, "malloc"); } else #endif target = *argv; @@ -404,7 +404,7 @@ main(int argc, char *argv[]) hostname = res->ai_canonname ? strdup(res->ai_canonname) : target; if (!hostname) - errx(1, "malloc"); + err(1, "malloc"); } if (res->ai_next) { @@ -579,7 +579,7 @@ main(int argc, char *argv[]) if (hoplimit != -1) { /* set IP6 packet options */ if ((scmsg = malloc( CMSG_SPACE(sizeof(int)))) == NULL) - errx(1, "can't allocate enough memory"); + err(1, "malloc"); smsghdr.msg_control = (caddr_t)scmsg; smsghdr.msg_controllen = CMSG_SPACE(sizeof(int)); |