Skip to content

Commit

Permalink
OS-8251 libtopo plugins have uninitialized variables (#344)
Browse files Browse the repository at this point in the history
Actually-authored-by: Robert Mustacchi <rm@fingolfin.org>
Reviewed by: Jason King <jbk@joyent.com>
Approved by: Mike Zeller <mike.zeller@joyent.com>
  • Loading branch information
Dan McDonald committed Feb 18, 2021
1 parent 007468e commit 3e2541c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions usr/src/lib/fm/topo/modules/common/ipmi/ipmi_enum.c
Expand Up @@ -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 *));
}
Expand Down

0 comments on commit 3e2541c

Please sign in to comment.