From: Joseph Sutton Date: Mon, 22 May 2023 23:16:56 +0000 (+1200) Subject: s3:utils: Check return value of json_new_object() X-Git-Tag: talloc-2.4.1~581 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80b3752052aa9234d8317ee6c671dcda64dcdf3f;p=thirdparty%2Fsamba.git s3:utils: Check return value of json_new_object() Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source3/utils/status.c b/source3/utils/status.c index 5359dda90cc..cbdb0de67ed 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -1078,7 +1078,9 @@ int main(int argc, const char *argv[]) #ifdef HAVE_JANSSON state.root_json = json_new_object(); - add_general_information_to_json(&state); + if (!json_is_invalid(&state.root_json)) { + add_general_information_to_json(&state); + } #else /* HAVE_JANSSON */ if (state.json_output) { fprintf(stderr, "JSON support not available, please install lib Jansson\n");