]> granicus.if.org Git - zfs/commitdiff
Fix zdb crash
authorIgor K <igor@dilos.org>
Tue, 19 Feb 2019 19:15:22 +0000 (22:15 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 19 Feb 2019 19:15:22 +0000 (11:15 -0800)
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 #8402

lib/libzpool/util.c

index 87772bcb70a859df53b9952ee186c214bc4019c8..ad05d2239ae04ab9f9a752739014bbb87010c575 100644 (file)
@@ -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;
@@ -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);
        }
 }