diff options
author | Benjamin ROBIN <dev@benjarobin.fr> | 2024-01-14 18:17:10 +0100 |
---|---|---|
committer | Yordan Karadzhov <y.karadz@gmail.com> | 2024-01-20 14:34:13 +0200 |
commit | 3ef17e14b4a2f48fbaaba2a9d5c721f5e71c0585 (patch) | |
tree | 593166969697126e317dc1e05a5d1590b60e6f75 | |
parent | 00cf0853b4e23346a8c15c961e8467c6e4668401 (diff) | |
download | kernel-shark-3ef17e14b4a2f48fbaaba2a9d5c721f5e71c0585.tar.gz |
kernelshark: Fix potential access to uninitialized variable
Always call json_object_put() with a valid "jlist" pointer.
Signed-off-by: Benjamin ROBIN <dev@benjarobin.fr>
Signed-off-by: Yordan Karadzhov <y.karadz@gmail.com>
-rw-r--r-- | src/libkshark-configio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libkshark-configio.c b/src/libkshark-configio.c index 9a1ba607..cdbc3ad1 100644 --- a/src/libkshark-configio.c +++ b/src/libkshark-configio.c @@ -773,7 +773,7 @@ static bool kshark_plugin_from_json(struct kshark_context *kshark_ctx, static bool kshark_all_plugins_from_json(struct kshark_context *kshark_ctx, struct json_object *jobj) { - struct json_object *jlist, *jfile; + struct json_object *jlist = NULL, *jfile = NULL; int i, n_plugins; if (!kshark_ctx || !jobj) @@ -896,7 +896,7 @@ static bool kshark_stream_plugins_from_json(struct kshark_context *kshark_ctx, int i, n_plugins; bool active; - jplg = jname = jstatus = NULL; + jlist = jplg = jname = jstatus = NULL; if (!kshark_ctx || !stream || !jobj) return false; |