From 5b0203da39eab8233a1c2941360225c7663aadb8 Mon Sep 17 00:00:00 2001 From: Asmir Selimovic Date: Thu, 30 Jan 2020 11:25:23 +0100 Subject: [PATCH] - Fixed memory leak in dataset_list_callb --- zfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zfs.c b/zfs.c index 99e620b..9eb0093 100644 --- a/zfs.c +++ b/zfs.c @@ -40,11 +40,11 @@ void dataset_list_free(dataset_list_t *list) { int dataset_list_callb(zfs_handle_t *dataset, void *data) { dataset_list_t **lroot = (dataset_list_t**)data; - dataset_list_t *nroot = create_dataset_list_item(); if ( !((*lroot)->zh) ) { (*lroot)->zh = dataset; } else { + dataset_list_t *nroot = create_dataset_list_item(); nroot->zh = dataset; nroot->pnext = (void*)*lroot; *lroot = nroot;