Author: mav
Date: Sat Jul 29 11:27:54 2017
New Revision: 321683
URL: https://svnweb.freebsd.org/changeset/base/321683

Log:
  MFC r314504 (by tsoome):
  loader: r314112 did introduce dereference freed pointer entry
  
  CID:          1371675
  Reported by:    Coverity
  Differential Revision:  https://reviews.freebsd.org/D9846

Modified:
  stable/11/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/boot/zfs/zfsimpl.c
==============================================================================
--- stable/11/sys/boot/zfs/zfsimpl.c    Sat Jul 29 10:31:57 2017        
(r321682)
+++ stable/11/sys/boot/zfs/zfsimpl.c    Sat Jul 29 11:27:54 2017        
(r321683)
@@ -2217,7 +2217,7 @@ zfs_lookup(const struct zfsmount *mount, const char *u
        char path[1024];
        int symlinks_followed = 0;
        struct stat sb;
-       struct obj_list *entry;
+       struct obj_list *entry, *tentry;
        STAILQ_HEAD(, obj_list) on_cache = STAILQ_HEAD_INITIALIZER(on_cache);
 
        spa = mount->spa;
@@ -2365,7 +2365,7 @@ zfs_lookup(const struct zfsmount *mount, const char *u
 
        *dnode = dn;
 done:
-       STAILQ_FOREACH(entry, &on_cache, entry)
+       STAILQ_FOREACH_SAFE(entry, &on_cache, entry, tentry)
                free(entry);
        return (rc);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to