Author: trasz
Date: Thu Feb 26 09:08:48 2015
New Revision: 279314
URL: https://svnweb.freebsd.org/changeset/base/279314
Log:
Add missing error check.
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Modified:
head/usr.sbin/ctld/parse.y
Modified: head/usr.sbin/ctld/parse.y
==============================================================================
--- head/usr.sbin/ctld/parse.y Thu Feb 26 07:51:43 2015 (r279313)
+++ head/usr.sbin/ctld/parse.y Thu Feb 26 09:08:48 2015 (r279314)
@@ -774,6 +774,7 @@ target_lun: LUN lun_number
lun_number: STR
{
uint64_t tmp;
+ int ret;
char *name;
if (expand_number($1, &tmp) != 0) {
@@ -782,7 +783,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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"