summaryrefslogtreecommitdiff
path: root/usr/src/lib/fm
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2021-02-18 17:29:13 -0500
committerGitHub <noreply@github.com>2021-02-18 17:29:13 -0500
commit3e2541c04964508e92c825796649f5cd5f8bf299 (patch)
tree0d7ff1eab06cff61522d8e62310721dca1ef6e0f /usr/src/lib/fm
parent007468eb6c693b6d901ecd630b8f1909e41100bf (diff)
downloadillumos-joyent-3e2541c04964508e92c825796649f5cd5f8bf299.tar.gz
OS-8251 libtopo plugins have uninitialized variables (#344)
Actually-authored-by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Jason King <jbk@joyent.com> Approved by: Mike Zeller <mike.zeller@joyent.com>
Diffstat (limited to 'usr/src/lib/fm')
-rw-r--r--usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c b/usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c
index 981596e4dc..96149ccc2e 100644
--- a/usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c
+++ b/usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c
@@ -860,9 +860,13 @@ ipmi_enum_sp(topo_mod_t *mod, tnode_t *pnode)
}
ret = 0;
out:
- if (lancfg.ilc_ipv6_nroutes > 0) {
- for (i = 0; i < lancfg.ilc_ipv6_nroutes; i++)
- topo_mod_free(mod, ipv6_routes[i], INET6_ADDRSTRLEN);
+ if (lancfg.ilc_ipv6_nroutes > 0 && ipv6_routes != NULL) {
+ for (i = 0; i < lancfg.ilc_ipv6_nroutes; i++) {
+ if (ipv6_routes[i] != NULL) {
+ topo_mod_free(mod, ipv6_routes[i],
+ INET6_ADDRSTRLEN);
+ }
+ }
topo_mod_free(mod, ipv6_routes,
lancfg.ilc_ipv6_nroutes * sizeof (char *));
}