diff options
author | Richard Yao <[email protected]> | 2022-09-23 13:51:14 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-23 10:51:14 -0700 |
commit | d25153d55568afc92a7b3ec8329d7fbad7382a80 (patch) | |
tree | d9987bc780bf9772dfa836ad09daac16225b09af /etc/zfs | |
parent | e9b12d4196c07cc26e8c9b1826f6d091617cae53 (diff) |
set_global_var_parse_kv() should pass the pointer from strdup()
A comment says that the caller should free k_out, but the pointer passed
via k_out is not the same pointer we received from strdup(). Instead,
it is a pointer into the region we received from strdup(). The free
function should always be called with the original pointer, so this is
likely a bug.
We solve this by calling `strdup()` a second time and then freeing the
original pointer.
Coverity reported this as a memory leak.
Reviewed-by: Neal Gompa <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #13867
Diffstat (limited to 'etc/zfs')
0 files changed, 0 insertions, 0 deletions