summaryrefslogtreecommitdiff
path: root/tools-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools-util.h')
-rw-r--r--tools-util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools-util.h b/tools-util.h
index 8451b117..732c5108 100644
--- a/tools-util.h
+++ b/tools-util.h
@@ -26,7 +26,9 @@ do { \
#define mprintf(...) \
({ \
char *_str; \
- asprintf(&_str, __VA_ARGS__); \
+ int ret = asprintf(&_str, __VA_ARGS__); \
+ if (ret < 0) \
+ die("insufficient memory"); \
_str; \
})