diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 1101d02..70bf669 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -2445,6 +2443,8 @@ ctl_copyin_args(int num_args, struct ctl_be_arg *uargs, && (tmpptr[args[i].vallen - 1] != '\0')) { snprintf(error_str, error_str_len, "Argument " "%d value is not NUL-terminated", i); + free(tmpptr, M_CTL); + tmpptr = NULL; goto bailout; } args[i].kvalue = tmpptr;