svn commit: r250976 - stable/9/usr.sbin/ctladm
Jaakko Heinonen
jh at FreeBSD.org
Sat May 25 09:47:33 UTC 2013
Author: jh
Date: Sat May 25 09:47:33 2013
New Revision: 250976
URL: http://svnweb.freebsd.org/changeset/base/250976
Log:
MFC r250443: Check the return value of sbuf_finish().
Modified:
stable/9/usr.sbin/ctladm/ctladm.c
Directory Properties:
stable/9/usr.sbin/ctladm/ (props changed)
Modified: stable/9/usr.sbin/ctladm/ctladm.c
==============================================================================
--- stable/9/usr.sbin/ctladm/ctladm.c Sat May 25 07:17:16 2013 (r250975)
+++ stable/9/usr.sbin/ctladm/ctladm.c Sat May 25 09:47:33 2013 (r250976)
@@ -545,7 +545,8 @@ retry:
}
if (xml != 0) {
sbuf_printf(sb, "</ctlfelist>\n");
- sbuf_finish(sb);
+ if (sbuf_finish(sb) != 0)
+ err(1, "%s: sbuf_finish", __func__);
printf("%s", sbuf_data(sb));
sbuf_delete(sb);
}
@@ -3492,7 +3493,8 @@ cctl_end_element(void *user_data, const
errx(1, "%s: no valid sbuf at level %d (name %s)", __func__,
devlist->level, name);
- sbuf_finish(devlist->cur_sb[devlist->level]);
+ if (sbuf_finish(devlist->cur_sb[devlist->level]) != 0)
+ err(1, "%s: sbuf_finish", __func__);
str = strdup(sbuf_data(devlist->cur_sb[devlist->level]));
if (str == NULL)
err(1, "%s can't allocate %zd bytes for string", __func__,
More information about the svn-src-stable-9
mailing list