freebsd-dev/contrib
Richard Yao f7bda2de97
Fix userspace memory leaks found by Clang Static Analzyer
Recently, I have been making a push to fix things that coverity found.
However, I was curious what Clang's static analyzer reported, so I ran
it and found things that coverity had missed.

* contrib/pam_zfs_key/pam_zfs_key.c: If prop_mountpoint is passed more
  than once, we leak memory.
* module/zfs/zcp_get.c: We leak memory on temporary properties in
  userspace.
* tests/zfs-tests/cmd/draid.c: On error from vdev_draid_rand(), we leak
  memory if best_map had been allocated by a prior iteration.
* tests/zfs-tests/cmd/mkfile.c: Memory used by the loop is not freed
  before program termination.

Arguably, these are all minor issues, but if we ignore them, then they
could obscure serious bugs, so we fix them.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13955
2022-09-26 17:18:05 -07:00
..
bash_completion.d contrib: bash_completion.d: install, fix dist 2022-05-10 10:20:40 -07:00
bpftrace Replace EXTRA_DIST with dist_noinst_DATA 2022-05-26 09:24:50 -07:00
coverity Update coverity model 2022-09-16 13:45:15 -07:00
dracut contrib: dracut: zfs-snapshot-bootfs: exit status fix 2022-08-12 14:28:15 -07:00
initramfs Replace EXTRA_DIST with dist_noinst_DATA 2022-05-26 09:24:50 -07:00
intel_qat Add intel_QAT patches 2020-09-30 13:17:30 -07:00
pam_zfs_key Fix userspace memory leaks found by Clang Static Analzyer 2022-09-26 17:18:05 -07:00
pyzfs Fix checkstyle warning: E275 missing whitespace after keyword 2022-08-01 09:49:35 -07:00
zcp Replace EXTRA_DIST with dist_noinst_DATA 2022-05-26 09:24:50 -07:00
Makefile.am autoconf: use include directives instead of recursing down contrib 2022-05-10 10:19:44 -07:00