]> git.proxmox.com Git - mirror_zfs.git/commit
Fix allocation errors, detected using ASAN
authorJoao Carlos Mendes Luis <dioni21@users.noreply.github.com>
Mon, 13 Apr 2020 17:54:41 +0000 (14:54 -0300)
committerGitHub <noreply@github.com>
Mon, 13 Apr 2020 17:54:41 +0000 (10:54 -0700)
commit75c62019f3938e7bc81becb4fb2d5b5eb523e79a
treed0560a68a02f7c3e5436d3edf75c7a91b75ff100
parent791e480c6ac7a3e33adc5270b3fc99015f9f0c15
Fix allocation errors, detected using ASAN

The test for VDEV_TYPE_INDIRECT is done after a memory allocation, and
could return from function without freeing it.  Since we don't need that
allocation yet, just postpone it.

Add a missing free() when buffer is no longer needed.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: João Carlos Mendes Luís <jonny@jonny.eng.br>
Closes #10193
cmd/zpool/zpool_main.c