From 8073936b4692989f9ed89dcd0853fb1e73fc37d3 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 27 May 2014 21:46:04 +1000 Subject: [PATCH] Check for incorrect return value on asprintf --- src/ckpool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ckpool.h b/src/ckpool.h index 4d8d69c6..f33b6020 100644 --- a/src/ckpool.h +++ b/src/ckpool.h @@ -111,7 +111,7 @@ ckpool_t *global_ckp; int process_exit(ckpool_t *ckp, proc_instance_t *pi, int ret); #define ASPRINTF(strp, fmt, ...) do { \ - if (unlikely(asprintf(strp, fmt, ##__VA_ARGS__))) \ + if (unlikely(asprintf(strp, fmt, ##__VA_ARGS__) < 0)) \ quitfrom(1, __FILE__, __func__, __LINE__, "Failed to asprintf"); \ } while (0)