Browse code

bb11524 - malloc() NULL pointer check. Patch by Bill Parker.

Steven Morgan authored on 2016/03/12 05:48:01
Showing 1 changed files
... ...
@@ -497,8 +497,8 @@ static void print_con_info(conn_t *conn, const char *fmt, ...)
497 497
 	va_start(ap, fmt);
498 498
 	if (stats_head_window) {
499 499
 		char *buf = malloc(maxx);
500
-		memset(buf, ' ', maxx);
501 500
 		OOM_CHECK(buf);
501
+		memset(buf, ' ', maxx);
502 502
 		vsnprintf(buf, maxx-1, fmt, ap);
503 503
 		buf[strlen(buf)] = ' ';
504 504
 		buf[maxx-1] = '\0';