Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Feb 2015 17:10:46 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r279056 - stable/10/usr.sbin/ctld
Message-ID:  <201502201710.t1KHAkFY071345@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Feb 20 17:10:46 2015
New Revision: 279056
URL: https://svnweb.freebsd.org/changeset/base/279056

Log:
  MFC r278594: Add missing asprintf() status checks.

Modified:
  stable/10/usr.sbin/ctld/ctld.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ctld/ctld.c
==============================================================================
--- stable/10/usr.sbin/ctld/ctld.c	Fri Feb 20 17:09:49 2015	(r279055)
+++ stable/10/usr.sbin/ctld/ctld.c	Fri Feb 20 17:10:46 2015	(r279056)
@@ -1191,8 +1191,11 @@ port_new(struct conf *conf, struct targe
 {
 	struct port *port;
 	char *name;
+	int ret;
 
-	asprintf(&name, "%s-%s", pg->pg_name, target->t_name);
+	ret = asprintf(&name, "%s-%s", pg->pg_name, target->t_name);
+	if (ret <= 0)
+		log_err(1, "asprintf");
 	if (port_find(conf, name) != NULL) {
 		log_warnx("duplicate port \"%s\"", name);
 		free(name);
@@ -1216,8 +1219,11 @@ port_new_pp(struct conf *conf, struct ta
 {
 	struct port *port;
 	char *name;
+	int ret;
 
-	asprintf(&name, "%s-%s", pp->pp_name, target->t_name);
+	ret = asprintf(&name, "%s-%s", pp->pp_name, target->t_name);
+	if (ret <= 0)
+		log_err(1, "asprintf");
 	if (port_find(conf, name) != NULL) {
 		log_warnx("duplicate port \"%s\"", name);
 		free(name);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502201710.t1KHAkFY071345>