7990 libzfs: snapspec_cb() does not need to call zfs_strdup()

Review Request #409 — Created March 21, 2017 and submitted

marcel
illumos-gate
master
7990
582dea4...
general
The snapspec_cb() callback function in libzfs does not need to call
zfs_strdup().
I called zfs_iter_snapspec() with "%" as the spec_orig to make sure it still
works as expected and there is no regression.
  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
tsoome
  1. Ship It!
  2. 
      
yuripv
  1. 
      
  2. usr/src/lib/libzfs/common/libzfs_iter.c (Diff revision 1)
     
     

    So what exactly happens here, if ssa_seenfirst isn't true and we did zfs_close(zhp)? Will not that be "use after free" as shortsnapname now will be pointing somewhere in zhp which we freed?

    1. OMG, what I was thinking about when I looked at it? :-)
  3. 
      
marcel
yuripv
  1. Ship It!
  2. 
      
tsoome
  1. Ship It!
  2. 
      
marcel
Review request changed

Status: Closed (submitted)

Change Summary:

commit d8584ba6fb7a5e46da1725845b99ae5fab5a4baf
Author:     Marcel Telka <marcel@telka.sk>
AuthorDate: Tue Mar 21 10:31:27 2017 +0100
Commit:     Matthew Ahrens <mahrens@delphix.com>
CommitDate: Tue Mar 21 17:01:07 2017 -0700

    7990 libzfs: snapspec_cb() does not need to call zfs_strdup()
    Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Matthew Ahrens <mahrens@delphix.com>

:100644 100644 91ae6f3... f5ac68f... M	usr/src/lib/libzfs/common/libzfs_iter.c
Loading...