From: Florian Forster Date: Fri, 20 Jun 2008 12:47:16 +0000 (+0200) Subject: src/common.c: Not enough memory is an error, not a debug message! X-Git-Tag: collectd-4.4.2~4^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6e46ec6b9cdc3bd7dbc8144505ea04d9b93a5cd9;p=collectd.git src/common.c: Not enough memory is an error, not a debug message! --- diff --git a/src/common.c b/src/common.c index 56fa6962..82b4aaae 100644 --- a/src/common.c +++ b/src/common.c @@ -70,12 +70,12 @@ char *sstrdup (const char *s) if((r = strdup (s)) == NULL) { - DEBUG ("Not enough memory."); - exit(3); + ERROR ("Not enough memory."); + exit (3); } return (r); -} +} /* char *sstrdup */ /* Even though Posix requires "strerror_r" to return an "int", * some systems (e.g. the GNU libc) return a "char *" _and_ @@ -131,12 +131,12 @@ void *smalloc (size_t size) if ((r = malloc (size)) == NULL) { - DEBUG("Not enough memory."); - exit(3); + ERROR ("Not enough memory."); + exit (3); } - return r; -} + return (r); +} /* void *smalloc */ #if 0 void sfree (void **ptr)