diff options
author | mav <mav@FreeBSD.org> | 2015-10-05 07:33:54 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-05 07:33:54 +0000 |
commit | f3e1fd582ee826d78d5b027d832a2148470c5b85 (patch) | |
tree | 3ffff0185f66f092659a30457dcd609c398a043f | |
parent | f7a8b2b7ade73eb84b0940ce2e0cfca697f6edea (diff) | |
download | FreeBSD-src-f3e1fd582ee826d78d5b027d832a2148470c5b85.zip FreeBSD-src-f3e1fd582ee826d78d5b027d832a2148470c5b85.tar.gz |
MFC r279314 (by trasz): Add missing error check.
-rw-r--r-- | usr.sbin/ctld/parse.y | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/ctld/parse.y b/usr.sbin/ctld/parse.y index af481fe..4c3844a 100644 --- a/usr.sbin/ctld/parse.y +++ b/usr.sbin/ctld/parse.y @@ -761,6 +761,7 @@ target_lun: LUN lun_number lun_number: STR { uint64_t tmp; + int ret; char *name; if (expand_number($1, &tmp) != 0) { @@ -769,7 +770,9 @@ lun_number: STR return (1); } - asprintf(&name, "%s,lun,%ju", target->t_name, tmp); + ret = asprintf(&name, "%s,lun,%ju", target->t_name, tmp); + if (ret <= 0) + log_err(1, "asprintf"); lun = lun_new(conf, name); if (lun == NULL) return (1); |