summaryrefslogtreecommitdiff
path: root/src/journal/journald-audit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journald-audit.c')
-rw-r--r--src/journal/journald-audit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
index 71d9282ed5..fae9138ecb 100644
--- a/src/journal/journald-audit.c
+++ b/src/journal/journald-audit.c
@@ -264,8 +264,8 @@ static int map_all_fields(
if (handle_msg) {
v = startswith(p, "msg='");
if (v) {
+ _cleanup_free_ char *c = NULL;
const char *e;
- char *c;
/* Userspace message. It's enclosed in
simple quotation marks, is not
@@ -279,7 +279,10 @@ static int map_all_fields(
if (!e)
return 0; /* don't continue splitting up if the final quotation mark is missing */
- c = strndupa(v, e - v);
+ c = strndup(v, e - v);
+ if (!c)
+ return -ENOMEM;
+
return map_all_fields(c, map_fields_userspace, "AUDIT_FIELD_", false, iov, n_iov_allocated, n_iov);
}
}