From f3e1fd582ee826d78d5b027d832a2148470c5b85 Mon Sep 17 00:00:00 2001 From: mav Date: Mon, 5 Oct 2015 07:33:54 +0000 Subject: MFC r279314 (by trasz): Add missing error check. --- usr.sbin/ctld/parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.1