diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 1101d024f05e..bc94d437abd4 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -2445,6 +2445,7 @@ 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); goto bailout; } args[i].kvalue = tmpptr;