Module Name:    src
Committed By:   nia
Date:           Sat Oct 30 11:37:18 UTC 2021

Modified Files:
        src/usr.bin/telnet: telnet.c

Log Message:
telnet(1): use reallocarr instead of malloc(x * y)


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/telnet/telnet.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/telnet/telnet.c
diff -u src/usr.bin/telnet/telnet.c:1.42 src/usr.bin/telnet/telnet.c:1.43
--- src/usr.bin/telnet/telnet.c:1.42	Sat Jan  5 06:47:24 2019
+++ src/usr.bin/telnet/telnet.c	Sat Oct 30 11:37:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: telnet.c,v 1.42 2019/01/05 06:47:24 maya Exp $	*/
+/*	$NetBSD: telnet.c,v 1.43 2021/10/30 11:37:18 nia Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)telnet.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: telnet.c,v 1.42 2019/01/05 06:47:24 maya Exp $");
+__RCSID("$NetBSD: telnet.c,v 1.43 2021/10/30 11:37:18 nia Exp $");
 #endif
 #endif /* not lint */
 
@@ -578,8 +578,8 @@ mklist(char *buf, char *name)
 	/*
 	 * Allocate an array to put the name pointers into
 	 */
-	argv = (char **)malloc((n+3)*sizeof(char *));
-	if (argv == 0)
+	argv = NULL:
+	if (reallocarr(&argv, n + 3, sizeof(char *)) != 0)
 		return(unknown);
 
 	/*

Reply via email to