460b6e
diff -up libnl-1.0-pre8/include/netlink-local.h.use-vasprintf-retval libnl-1.0-pre8/include/netlink-local.h
460b6e
--- libnl-1.0-pre8/include/netlink-local.h.use-vasprintf-retval	2007-12-03 14:13:52.000000000 -0500
460b6e
+++ libnl-1.0-pre8/include/netlink-local.h	2007-12-03 14:15:26.000000000 -0500
460b6e
@@ -273,13 +273,18 @@ static inline void __dp_dump(struct nl_d
460b6e
 		vfprintf(parms->dp_fd, fmt, args);
460b6e
 	else if (parms->dp_buf || parms->dp_cb) {
460b6e
 		char *buf = NULL;
460b6e
-		vasprintf(&buf, fmt, args);
460b6e
-		if (parms->dp_cb)
460b6e
-			parms->dp_cb(parms, buf);
460b6e
-		else
460b6e
-			strncat(parms->dp_buf, buf,
460b6e
-			        parms->dp_buflen - strlen(parms->dp_buf) - 1);
460b6e
-		free(buf);
460b6e
+		int ret;
460b6e
+		ret = vasprintf(&buf, fmt, args);
460b6e
+		if (ret >= 0) {
460b6e
+			if (parms->dp_cb)
460b6e
+				parms->dp_cb(parms, buf);
460b6e
+			else
460b6e
+				strncat(parms->dp_buf, buf,
460b6e
+				        parms->dp_buflen - strlen(parms->dp_buf) - 1);
460b6e
+			free(buf);
460b6e
+		} else {
460b6e
+			// FIXME: indicate error somehow
460b6e
+		}
460b6e
 	}
460b6e
 }
460b6e