> On 29. Mar 2020, at 00:04, Oliver Pinter <oliver.p...@gmail.com> wrote: > > > > On Saturday, March 28, 2020, Toomas Soome <tso...@freebsd.org > <mailto:tso...@freebsd.org>> wrote: > Author: tsoome > Date: Sat Mar 28 21:50:27 2020 > New Revision: 359408 > URL: https://svnweb.freebsd.org/changeset/base/359408 > <https://svnweb.freebsd.org/changeset/base/359408> > > Log: > loader: strdup name strings from dataset walker > > The removal of zfs scratch buffer did miss the fact the dataset > lookup was picking up the names from zap list. > > Modified: > head/stand/libsa/zfs/zfs.c > > Modified: head/stand/libsa/zfs/zfs.c > ============================================================================== > --- head/stand/libsa/zfs/zfs.c Sat Mar 28 21:47:44 2020 (r359407) > +++ head/stand/libsa/zfs/zfs.c Sat Mar 28 21:50:27 2020 (r359408) > @@ -92,7 +92,7 @@ static int zfs_env_count; > SLIST_HEAD(zfs_be_list, zfs_be_entry) zfs_be_head = > SLIST_HEAD_INITIALIZER(zfs_be_head); > struct zfs_be_list *zfs_be_headp; > struct zfs_be_entry { > - const char *name; > + cha *name; > > I think this will be "char *".
Yes, I guess I must have (accidentally) removed the ‘r' after the build. The fix is already posted. rgds, toomas > > SLIST_ENTRY(zfs_be_entry) entries; > } *zfs_be, *zfs_be_tmp; > > @@ -906,6 +906,7 @@ zfs_bootenv_initial(const char *name) > while (!SLIST_EMPTY(&zfs_be_head)) { > zfs_be = SLIST_FIRST(&zfs_be_head); > SLIST_REMOVE_HEAD(&zfs_be_head, entries); > + free(zfs_be->name); > free(zfs_be); > } > > @@ -973,6 +974,7 @@ zfs_bootenv(const char *name) > while (!SLIST_EMPTY(&zfs_be_head)) { > zfs_be = SLIST_FIRST(&zfs_be_head); > SLIST_REMOVE_HEAD(&zfs_be_head, entries); > + free(zfs_be->name); > free(zfs_be); > } > > @@ -992,7 +994,11 @@ zfs_belist_add(const char *name, uint64_t value __unus > if (zfs_be == NULL) { > return (ENOMEM); > } > - zfs_be->name = name; > + zfs_be->name = strdup(name); > + if (zfs_be->name == NULL) { > + free(zfs_be); > + return (ENOMEM); > + } > SLIST_INSERT_HEAD(&zfs_be_head, zfs_be, entries); > zfs_env_count++; > > _______________________________________________ > svn-src-h...@freebsd.org <mailto:svn-src-h...@freebsd.org> mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > <https://lists.freebsd.org/mailman/listinfo/svn-src-head> > To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org > <mailto:svn-src-head-unsubscr...@freebsd.org>" _______________________________________________ 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"