Print this page
patch tsoome-feedback

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zoneadm/zfs.c
          +++ new/usr/src/cmd/zoneadm/zfs.c
↓ open down ↓ 373 lines elided ↑ open up ↑
 374  374          /*
 375  375           * We turn off zfs SHARENFS and SHARESMB properties on the
 376  376           * zoneroot dataset in order to prevent the GZ from sharing
 377  377           * NGZ data by accident.
 378  378           */
 379  379          if ((nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) ||
 380  380              (nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARENFS),
 381  381              "off") != 0) ||
 382  382              (nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARESMB),
 383  383              "off") != 0)) {
 384      -                if (props != NULL)
 385      -                        nvlist_free(props);
      384 +                nvlist_free(props);
 386  385                  (void) fprintf(stderr, gettext("could not create ZFS clone "
 387  386                      "%s: out of memory\n"), zonepath);
 388  387                  return (Z_ERR);
 389  388          }
 390  389  
 391  390          err = zfs_clone(zhp, zonepath, props);
 392  391          zfs_close(zhp);
 393  392  
 394  393          nvlist_free(props);
 395  394  
↓ open down ↓ 585 lines elided ↑ open up ↑
 981  980          /*
 982  981           * We turn off zfs SHARENFS and SHARESMB properties on the
 983  982           * zoneroot dataset in order to prevent the GZ from sharing
 984  983           * NGZ data by accident.
 985  984           */
 986  985          if ((nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) ||
 987  986              (nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARENFS),
 988  987              "off") != 0) ||
 989  988              (nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARESMB),
 990  989              "off") != 0)) {
 991      -                if (props != NULL)
 992      -                        nvlist_free(props);
      990 +                nvlist_free(props);
 993  991                  (void) fprintf(stderr, gettext("cannot create ZFS dataset %s: "
 994  992                      "out of memory\n"), zfs_name);
 995  993          }
 996  994  
 997  995          if (zfs_create(g_zfs, zfs_name, ZFS_TYPE_FILESYSTEM, props) != 0 ||
 998  996              (zhp = zfs_open(g_zfs, zfs_name, ZFS_TYPE_DATASET)) == NULL) {
 999  997                  (void) fprintf(stderr, gettext("cannot create ZFS dataset %s: "
1000  998                      "%s\n"), zfs_name, libzfs_error_description(g_zfs));
1001  999                  nvlist_free(props);
1002 1000                  return;
↓ open down ↓ 678 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX