Skip to content

Commit

Permalink
Fix zdb crash
Browse files Browse the repository at this point in the history
We have to use umem_free() instead of free() if we are using
umem_zalloc()

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Igor Kozhukhov <igor@dilos.org>
Closes openzfs#8402
  • Loading branch information
ikozhukhov authored and behlendorf committed Feb 19, 2019
1 parent 435637d commit 790c880
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/libzpool/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ show_vdev_stats(const char *desc, const char *ctype, nvlist_t *nv, int indent)
vs->vs_space ? 6 : 0, vs->vs_space ? avail : "",
rops, wops, rbytes, wbytes, rerr, werr, cerr);
}
free(v0);
umem_free(v0, sizeof (*v0));

if (nvlist_lookup_nvlist_array(nv, ctype, &child, &children) != 0)
return;
Expand All @@ -124,7 +124,7 @@ show_vdev_stats(const char *desc, const char *ctype, nvlist_t *nv, int indent)
if (nvlist_lookup_uint64(cnv, ZPOOL_CONFIG_NPARITY, &np) == 0)
tname[strlen(tname)] = '0' + np;
show_vdev_stats(tname, ctype, cnv, indent + 2);
free(tname);
umem_free(tname, len);
}
}

Expand Down

0 comments on commit 790c880

Please sign in to comment.