diff options
| author | Mark Stapp <mjs@cisco.com> | 2025-03-27 15:16:05 -0400 |
|---|---|---|
| committer | Mark Stapp <mjs@cisco.com> | 2025-04-08 14:41:27 -0400 |
| commit | 27ba9956a15c17b7e8a6ba38aa8bbb4514fa90df (patch) | |
| tree | 0cb65e13b057e66321851e7f55686d179482e92d | |
| parent | e2515f7a4f6573f987435edd18ae8d6f8a3ee758 (diff) | |
lib,ripd: resolve clang SA warnings
Looks like there were a couple of SA warnings lurking; fix
them.
Signed-off-by: Mark Stapp <mjs@cisco.com>
| -rw-r--r-- | lib/northbound_oper.c | 3 | ||||
| -rw-r--r-- | ripd/ripd.c | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/northbound_oper.c b/lib/northbound_oper.c index 626c37082e..d9ad9b1701 100644 --- a/lib/northbound_oper.c +++ b/lib/northbound_oper.c @@ -157,7 +157,8 @@ nb_op_create_yield_state(const char *xpath, struct yang_translator *translator, /* remove trailing '/'s */ while (darr_len(ys->xpath) > 1 && ys->xpath[darr_len(ys->xpath) - 2] == '/') { darr_setlen(ys->xpath, darr_len(ys->xpath) - 1); - *darr_last(ys->xpath) = 0; + if (darr_last(ys->xpath)) + *darr_last(ys->xpath) = 0; } ys->xpath_orig = darr_strdup(xpath); ys->translator = translator; diff --git a/ripd/ripd.c b/ripd/ripd.c index 2d038507ab..c850df52ec 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -282,8 +282,14 @@ struct rip_info *rip_ecmp_replace(struct rip *rip, struct rip_info *rinfo_new) */ struct rip_info *rip_ecmp_delete(struct rip *rip, struct rip_info *rinfo) { - struct route_node *rp = rinfo->rp; - struct list *list = (struct list *)rp->info; + struct route_node *rp; + struct list *list; + + if (rinfo == NULL) + return NULL; + + rp = rinfo->rp; + list = (struct list *)rp->info; EVENT_OFF(rinfo->t_timeout); |
