From b977896d3691ddf9c2a2540a274b8454e536e2cb Mon Sep 17 00:00:00 2001 From: krw <> Date: Mon, 9 Jul 2018 12:05:11 +0000 Subject: [PATCH] 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@ --- src/usr.sbin/ntpd/parse.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/usr.sbin/ntpd/parse.y b/src/usr.sbin/ntpd/parse.y index 52e30138..e30926b3 100644 --- a/src/usr.sbin/ntpd/parse.y +++ b/src/usr.sbin/ntpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.68 2018/07/08 17:15:07 krw Exp $ */ +/* $OpenBSD: parse.y,v 1.69 2018/07/09 12:05:11 krw Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -733,16 +733,16 @@ pushfile(const char *name) 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); } if ((nfile->stream = fopen(nfile->name, "r")) == NULL) { - log_warn("%s", nfile->name); + log_warn("%s: %s", __func__, nfile->name); free(nfile->name); free(nfile); return (NULL);