diff options
author | Sumit Bose <sbose@redhat.com> | 2009-05-20 12:08:13 +0200 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2009-05-21 11:22:21 +1000 |
commit | 2fcedf6dac9dd275adbb0017e53547614df29d93 (patch) | |
tree | 94a290c1514cd2446139e31a6403466018355f73 /ctdb/lib/util/debug.c | |
parent | 11988fc77a06c50c251acec1dc8cc2c275f68310 (diff) | |
download | samba-2fcedf6dac9dd275adbb0017e53547614df29d93.tar.gz |
add missing checks on so far ignored return values
Most of these were found during a review by Jim Meyering <meyering@redhat.com>
(This used to be ctdb commit 3aee5ee1deb4a19be3bd3a4ce3abbe09de763344)
Diffstat (limited to 'ctdb/lib/util/debug.c')
-rw-r--r-- | ctdb/lib/util/debug.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ctdb/lib/util/debug.c b/ctdb/lib/util/debug.c index 341a4a1586a..9e819292200 100644 --- a/ctdb/lib/util/debug.c +++ b/ctdb/lib/util/debug.c @@ -28,8 +28,14 @@ static void _do_debug_v(const char *format, va_list ap) char *s = NULL; struct tm *tm; char tbuf[100]; - - vasprintf(&s, format, ap); + int ret; + + ret = vasprintf(&s, format, ap); + if (ret == -1) { + fprintf(stderr, "vasprintf failed in _do_debug_v, cannot print debug message.\n"); + fflush(stderr); + return; + } t = timeval_current(); tm = localtime(&t.tv_sec); |