From 256eb8a082d76cf84b6d87982a671107cf09e532 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 9 Jun 2017 18:05:07 -0400 Subject: [PATCH] Fix: uninitialized variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit query.c: In function 'trace_info_query': query.c:246:2: warning: 'stream_class' may be used uninitialized in this function [-Wmaybe-uninitialized] bt_put(stream_class); ^ query.c:216:30: note: 'stream_class' was declared here struct bt_ctf_stream_class *stream_class; ^ Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- plugins/ctf/fs-src/query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ctf/fs-src/query.c b/plugins/ctf/fs-src/query.c index 6fa7446f..3c53b51c 100644 --- a/plugins/ctf/fs-src/query.c +++ b/plugins/ctf/fs-src/query.c @@ -213,7 +213,7 @@ int add_stream_ids(struct bt_value *info, struct bt_ctf_stream *stream) int ret = 0; int64_t stream_class_id, stream_instance_id; enum bt_value_status status; - struct bt_ctf_stream_class *stream_class; + struct bt_ctf_stream_class *stream_class = NULL; stream_instance_id = bt_ctf_stream_get_id(stream); if (stream_instance_id != -1) { -- 2.34.1