summaryrefslogtreecommitdiffstats
path: root/usr.sbin/hostapd
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2018-07-09 12:05:10 +0000
committerkrw <krw@openbsd.org>2018-07-09 12:05:10 +0000
commit6a3d55f939083b5d9457342b25519eade91f9c38 (patch)
tree188f28c742c46075222046ad71a98373cd17f78e /usr.sbin/hostapd
parentExtend the v4_defroute() function description and make the fallback to (diff)
downloadwireguard-openbsd-6a3d55f939083b5d9457342b25519eade91f9c38.tar.xz
wireguard-openbsd-6a3d55f939083b5d9457342b25519eade91f9c38.zip
No need to mention which memory allocation entry point failed (malloc,
calloc or strdup), we just need to log that we ran out of memory in a particular function. Recommended by florian@ and deraadt@ ok benno@ henning@ tb@
Diffstat (limited to 'usr.sbin/hostapd')
-rw-r--r--usr.sbin/hostapd/parse.y10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y
index dbf97961a8e..aef75684e39 100644
--- a/usr.sbin/hostapd/parse.y
+++ b/usr.sbin/hostapd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.56 2018/06/11 09:09:36 denis Exp $ */
+/* $OpenBSD: parse.y,v 1.57 2018/07/09 12:05:11 krw Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@@ -1729,16 +1729,16 @@ pushfile(const char *name, int secret)
struct file *nfile;
if ((nfile = calloc(1, sizeof(struct file))) == NULL) {
- warn("out of memory");
+ warn("%s", __func__);
return (NULL);
}
if ((nfile->name = strdup(name)) == NULL) {
- warn("out of memory");
+ warn("%s", __func__);
free(nfile);
return (NULL);
}
if ((nfile->stream = fopen(nfile->name, "r")) == NULL) {
- warn("%s", nfile->name);
+ warn("%s: %s", __func__, nfile->name);
free(nfile->name);
free(nfile);
return (NULL);
@@ -1753,7 +1753,7 @@ pushfile(const char *name, int secret)
nfile->ungetsize = 16;
nfile->ungetbuf = malloc(nfile->ungetsize);
if (nfile->ungetbuf == NULL) {
- warn("malloc");
+ warn("%s", __func__);
fclose(nfile->stream);
free(nfile->name);
free(nfile);