diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2018-07-09 12:05:12 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2018-07-09 12:05:12 +0000 |
commit | 07783b4f5b173dfc558ad9ee983a219d1d1d47e7 (patch) | |
tree | d38338384343fb9b90ef5b6bc56754492c0509f9 /usr.sbin/vmd/parse.y | |
parent | 05f0f931ad684cb645ad517777a3d999636483c3 (diff) |
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/vmd/parse.y')
-rw-r--r-- | usr.sbin/vmd/parse.y | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/vmd/parse.y b/usr.sbin/vmd/parse.y index db6f834dc5c..af0c949c5c1 100644 --- a/usr.sbin/vmd/parse.y +++ b/usr.sbin/vmd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.37 2018/07/08 17:15:07 krw Exp $ */ +/* $OpenBSD: parse.y,v 1.38 2018/07/09 12:05:11 krw Exp $ */ /* * Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org> @@ -972,11 +972,11 @@ pushfile(const char *name, int secret) struct file *nfile; if ((nfile = calloc(1, sizeof(struct file))) == NULL) { - log_warn("calloc"); + log_warn("%s", __func__); return (NULL); } if ((nfile->name = strdup(name)) == NULL) { - log_warn("strdup"); + log_warn("%s", __func__); free(nfile); return (NULL); } @@ -989,7 +989,7 @@ pushfile(const char *name, int secret) nfile->ungetsize = 16; nfile->ungetbuf = malloc(nfile->ungetsize); if (nfile->ungetbuf == NULL) { - log_warn("malloc"); + log_warn("%s", __func__); fclose(nfile->stream); free(nfile->name); free(nfile); @@ -1188,7 +1188,7 @@ host(const char *str, struct address *h) const char *errstr; if ((s = strdup(str)) == NULL) { - log_warn("strdup"); + log_warn("%s", __func__); goto fail; } |