diff --git a/contrib/pam_zfs_key/pam_zfs_key.c b/contrib/pam_zfs_key/pam_zfs_key.c index c1001e6b81..aaca670080 100644 --- a/contrib/pam_zfs_key/pam_zfs_key.c +++ b/contrib/pam_zfs_key/pam_zfs_key.c @@ -480,7 +480,8 @@ zfs_key_config_load(pam_handle_t *pamh, zfs_key_config_t *config, } else if (strcmp(argv[c], "nounmount") == 0) { config->unmount_and_unload = 0; } else if (strcmp(argv[c], "prop_mountpoint") == 0) { - config->homedir = strdup(entry->pw_dir); + if (config->homedir == NULL) + config->homedir = strdup(entry->pw_dir); } } return (0); diff --git a/module/zfs/zcp_get.c b/module/zfs/zcp_get.c index 0a0466d469..8230a41936 100644 --- a/module/zfs/zcp_get.c +++ b/module/zfs/zcp_get.c @@ -472,6 +472,7 @@ get_zap_prop(lua_State *state, dsl_dataset_t *ds, zfs_prop_t zfs_prop) /* Fill in temporary value for prop, if applicable */ (void) zfs_get_temporary_prop(ds, zfs_prop, &numval, setpoint); #else + kmem_free(strval, ZAP_MAXVALUELEN); return (luaL_error(state, "temporary properties only supported in kernel mode", prop_name)); diff --git a/tests/zfs-tests/cmd/draid.c b/tests/zfs-tests/cmd/draid.c index 869ca902d0..39b58a709c 100644 --- a/tests/zfs-tests/cmd/draid.c +++ b/tests/zfs-tests/cmd/draid.c @@ -720,8 +720,11 @@ eval_maps(uint64_t children, int passes, uint64_t *map_seed, */ error = alloc_new_map(children, MAP_ROWS_DEFAULT, vdev_draid_rand(map_seed), &map); - if (error) + if (error) { + if (best_map != NULL) + free_map(best_map); return (error); + } /* * Consider maps with a lower worst_ratio to be of higher diff --git a/tests/zfs-tests/cmd/mkfile.c b/tests/zfs-tests/cmd/mkfile.c index 7ce50e6a37..3b61deed6b 100644 --- a/tests/zfs-tests/cmd/mkfile.c +++ b/tests/zfs-tests/cmd/mkfile.c @@ -276,5 +276,9 @@ main(int argc, char **argv) argv++; argc--; } + + if (buf) + free(buf); + return (errors); }