diff options
author | Andrew Bartlett <abartlet@samba.org> | 2018-12-14 15:40:20 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-12-14 10:27:18 +0100 |
commit | b776ba8042ac94b1fdda2d4073283a5609c8239c (patch) | |
tree | 8830b89fb90fd0befdc5f722fba511cbdbe5a357 /lib/audit_logging | |
parent | edab1318f9138c0d87de7cc7cfa5da8e29c906f8 (diff) | |
download | samba-b776ba8042ac94b1fdda2d4073283a5609c8239c.tar.gz |
lib/audit_logging: Use talloc_stackframe() in audit_log_json()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib/audit_logging')
-rw-r--r-- | lib/audit_logging/audit_logging.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/audit_logging/audit_logging.c b/lib/audit_logging/audit_logging.c index 644f72e09e1..42b93137c07 100644 --- a/lib/audit_logging/audit_logging.c +++ b/lib/audit_logging/audit_logging.c @@ -113,7 +113,7 @@ void audit_log_json(struct json_object* message, int debug_class, int debug_level) { - TALLOC_CTX *ctx = NULL; + TALLOC_CTX *frame = NULL; char *s = NULL; if (json_is_invalid(message)) { @@ -121,12 +121,12 @@ void audit_log_json(struct json_object* message, return; } - ctx = talloc_new(NULL); - s = json_to_string(ctx, message); + frame = talloc_stackframe(); + s = json_to_string(frame, message); if (s == NULL) { DBG_ERR("json_to_string returned NULL, " "JSON audit message could not written\n"); - TALLOC_FREE(ctx); + TALLOC_FREE(frame); return; } /* @@ -138,7 +138,7 @@ void audit_log_json(struct json_object* message, * can find such lines by the leading { */ DEBUGADDC(debug_class, debug_level, ("%s\n", s)); - TALLOC_FREE(ctx); + TALLOC_FREE(frame); } /* |