From d4cd0a896092e5fe699a2e52b8df25bb6ff8bfda Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 12 Aug 2022 01:15:06 +0200 Subject: fix warnings: 'uninitialized' Though these can never be used uninitialized, initialize to NULL to avoid compiler warnings like: pfcp_msg.c:188:66: warning: 'h_no_seid' may be used uninitialized Change-Id: Icb338b200fe3186ccd7fd3f502c1723f60947190 --- src/libosmo-gtlv/gtlv_dec_enc.c | 2 +- src/libosmo-pfcp/pfcp_msg.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/libosmo-gtlv/gtlv_dec_enc.c b/src/libosmo-gtlv/gtlv_dec_enc.c index 2e5509a..c3e45ea 100644 --- a/src/libosmo-gtlv/gtlv_dec_enc.c +++ b/src/libosmo-gtlv/gtlv_dec_enc.c @@ -71,7 +71,7 @@ static int osmo_gtlvs_decode_unordered(void *decoded_struct, unsigned int obj_of { void *obj = MEMB(decoded_struct, obj_ofs); const struct osmo_gtlv_coding *iec; - unsigned int *multi_count_p; + unsigned int *multi_count_p = NULL; /* To check for presence of mandatory IEs, need to keep a flag stack of seen ie_coding entries. This array has * to have at least the nr of entries that the ie_coding array has. Let's allow up to this many ie_coding diff --git a/src/libosmo-pfcp/pfcp_msg.c b/src/libosmo-pfcp/pfcp_msg.c index 5f55575..098ffa2 100644 --- a/src/libosmo-pfcp/pfcp_msg.c +++ b/src/libosmo-pfcp/pfcp_msg.c @@ -158,8 +158,8 @@ static unsigned int pfcp_header_get_message_length(const struct osmo_pfcp_header static int enc_pfcp_header(struct msgb *msg, const struct osmo_pfcp_msg *m) { const struct osmo_pfcp_header_parsed *parsed = &m->h; - struct osmo_pfcp_header_seid *h_seid; - struct osmo_pfcp_header_no_seid *h_no_seid; + struct osmo_pfcp_header_seid *h_seid = NULL; + struct osmo_pfcp_header_no_seid *h_no_seid = NULL; struct osmo_pfcp_header_common *c; int rc; -- cgit v1.2.3