kbuild: check return value of asprintf()
diff mbox

Message ID 1287757930-2766-1-git-send-email-namhyung@gmail.com
State New, archived
Headers show

Commit Message

Namhyung Kim Oct. 22, 2010, 2:32 p.m. UTC
None

Patch
diff mbox

diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
index fc3b18d..98dec87 100644
--- a/scripts/basic/docproc.c
+++ b/scripts/basic/docproc.c
@@ -333,7 +333,10 @@  static void docsect(char *filename, char *line)
 		if (*s == '\n')
 			*s = '\0';
 
-	asprintf(&s, "DOC: %s", line);
+	if (asprintf(&s, "DOC: %s", line) < 0) {
+		perror("asprintf");
+		exit(1);
+	}
 	consume_symbol(s);
 	free(s);