Skip to content

Commit

Permalink
8521 nvlist memory leak in get_clones_stat() and spa_load_best()
Browse files Browse the repository at this point in the history
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
pzakha authored and Prakash Surya committed Aug 1, 2017
1 parent e673284 commit 7d3000f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions usr/src/uts/common/fs/zfs/dsl_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1742,10 +1742,10 @@ get_clones_stat(dsl_dataset_t *ds, nvlist_t *nv)
fnvlist_add_nvlist(propval, ZPROP_VALUE, val);
fnvlist_add_nvlist(nv, zfs_prop_to_name(ZFS_PROP_CLONES),
propval);
} else {
nvlist_free(val);
nvlist_free(propval);
}

nvlist_free(val);
nvlist_free(propval);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions usr/src/uts/common/fs/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -3024,6 +3024,8 @@ spa_load_best(spa_t *spa, spa_load_state_t state, int mosconfig,

if (config && (rewind_error || state != SPA_LOAD_RECOVER))
spa_config_set(spa, config);
else
nvlist_free(config);

if (state == SPA_LOAD_RECOVER) {
ASSERT3P(loadinfo, ==, NULL);
Expand Down

0 comments on commit 7d3000f

Please sign in to comment.