Print this page
10125 smatch fixes for cmd-inet

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/usr.sbin/ipadm/ipadm.c
          +++ new/usr/src/cmd/cmd-inet/usr.sbin/ipadm/ipadm.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright 2017 Nexenta Systems, Inc.
  25      - * Copyright 2017 Joyent, Inc.
       25 + * Copyright (c) 2018, Joyent, Inc.
  26   26   * Copyright 2017 Gary Mills
  27   27   * Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
  28   28   */
  29   29  
  30   30  #include <arpa/inet.h>
  31   31  #include <errno.h>
  32   32  #include <getopt.h>
  33   33  #include <inet/ip.h>
  34   34  #include <inet/iptun.h>
  35   35  #include <inet/tunables.h>
↓ open down ↓ 1593 lines elided ↑ open up ↑
1629 1629  
1630 1630          (void) strncpy(phyname, lifname, sizeof (phyname));
1631 1631          if ((cp = strchr(phyname, ':')) != NULL)
1632 1632                  *cp = '\0';
1633 1633          status = ipadm_if_info(iph, phyname, &if_info, 0, LIFC_DEFAULT);
1634 1634          if (status != IPADM_SUCCESS)
1635 1635                  return (ret);
1636 1636  
1637 1637          if (if_info->ifi_cflags & IFIF_L3PROTECT)
1638 1638                  ret = _B_TRUE;
1639      -        if (if_info)
1640      -                ipadm_free_if_info(if_info);
     1639 +        ipadm_free_if_info(if_info);
1641 1640          return (ret);
1642 1641  }
1643 1642  
1644 1643  static boolean_t
1645 1644  print_sa_cb(ofmt_arg_t *ofarg, char *buf, uint_t bufsize)
1646 1645  {
1647 1646          show_addr_args_t        *arg = ofarg->ofmt_cbarg;
1648 1647          ipadm_addr_info_t       *ainfo = arg->sa_info;
1649 1648          char                    interface[LIFNAMSIZ];
1650 1649          char                    addrbuf[MAXPROPVALLEN];
↓ open down ↓ 570 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX