summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libsystemd/sd-bus/bus-error.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
index abdfd73204..5ca974a191 100644
--- a/src/libsystemd/sd-bus/bus-error.c
+++ b/src/libsystemd/sd-bus/bus-error.c
@@ -194,8 +194,13 @@ int bus_error_setfv(sd_bus_error *e, const char *name, const char *format, va_li
return -ENOMEM;
}
- if (format)
- vasprintf((char**) &e->message, format, ap);
+ if (format) {
+ int r;
+
+ r = vasprintf((char**) &e->message, format, ap);
+ if (r < 0)
+ return -ENOMEM;
+ }
e->_need_free = 1;