Print this page
patch cleanup
6659 nvlist_free(NULL) is a no-op

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libcontract/common/libcontract.c
          +++ new/usr/src/lib/libcontract/common/libcontract.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   26  #include <sys/ctfs.h>
  29   27  #include <sys/contract.h>
  30   28  #include <string.h>
  31   29  #include <libnvpair.h>
  32   30  #include <assert.h>
  33   31  #include <unistd.h>
  34   32  #include <errno.h>
  35   33  #include <libcontract.h>
  36   34  #include "libcontract_impl.h"
  37   35  
↓ open down ↓ 422 lines elided ↑ open up ↑
 460  458  
 461  459          free(event_buffer);
 462  460  
 463  461          *evt = info;
 464  462          return (0);
 465  463  
 466  464  errout:
 467  465          if (event_buffer)
 468  466                  free(event_buffer);
 469  467          if (info) {
 470      -                if (info->nvl)
 471      -                        nvlist_free(info->nvl);
      468 +                nvlist_free(info->nvl);
 472  469                  free(info);
 473  470          }
 474  471          return (error);
 475  472  }
 476  473  
 477  474  int
 478  475  ct_event_read(int fd, ct_evthdl_t *evthdl)
 479  476  {
 480  477          return (ct_event_read_internal(fd, CT_ERECV, evthdl));
 481  478  }
↓ open down ↓ 18 lines elided ↑ open up ↑
 500  497          if (ioctl(fd, CT_ERELIABLE) == -1)
 501  498                  return (errno);
 502  499          return (0);
 503  500  }
 504  501  
 505  502  void
 506  503  ct_event_free(ct_evthdl_t evthdl)
 507  504  {
 508  505          struct ctlib_event_info *info = evthdl;
 509  506  
 510      -        if (info->nvl)
 511      -                nvlist_free(info->nvl);
      507 +        nvlist_free(info->nvl);
 512  508          free(info);
 513  509  }
 514  510  
 515  511  
 516  512  uint_t
 517  513  ct_event_get_flags(ct_evthdl_t evthdl)
 518  514  {
 519  515          struct ctlib_event_info *info = evthdl;
 520  516          return (info->event.ctev_flags);
 521  517  }
↓ open down ↓ 41 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX