- Fixed memory leak in dataset_list_callb
This commit is contained in:
parent
e317057e63
commit
5b0203da39
2
zfs.c
2
zfs.c
|
@ -40,11 +40,11 @@ void dataset_list_free(dataset_list_t *list) {
|
||||||
|
|
||||||
int dataset_list_callb(zfs_handle_t *dataset, void *data) {
|
int dataset_list_callb(zfs_handle_t *dataset, void *data) {
|
||||||
dataset_list_t **lroot = (dataset_list_t**)data;
|
dataset_list_t **lroot = (dataset_list_t**)data;
|
||||||
dataset_list_t *nroot = create_dataset_list_item();
|
|
||||||
|
|
||||||
if ( !((*lroot)->zh) ) {
|
if ( !((*lroot)->zh) ) {
|
||||||
(*lroot)->zh = dataset;
|
(*lroot)->zh = dataset;
|
||||||
} else {
|
} else {
|
||||||
|
dataset_list_t *nroot = create_dataset_list_item();
|
||||||
nroot->zh = dataset;
|
nroot->zh = dataset;
|
||||||
nroot->pnext = (void*)*lroot;
|
nroot->pnext = (void*)*lroot;
|
||||||
*lroot = nroot;
|
*lroot = nroot;
|
||||||
|
|
Loading…
Reference in New Issue