From 1ec5b2905484b7904aabb01f56c70265fb538c82 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 29 May 2006 07:42:02 +0000 Subject: More size shrinkage. --- networking/telnetd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'networking') diff --git a/networking/telnetd.c b/networking/telnetd.c index 5a11ffb8c..f2038395f 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c @@ -3,7 +3,7 @@ * Simple telnet server * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) * - * Licensed under GPL, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * * --------------------------------------------------------------------------- * (C) Copyright 2000, Axis Communications AB, LUND, SWEDEN @@ -260,21 +260,17 @@ make_new_session(int sockfd) struct termios termbuf; int pty, pid; char tty_name[32]; - struct tsession *ts = malloc(sizeof(struct tsession) + BUFSIZE * 2); + struct tsession *ts = xzalloc(sizeof(struct tsession) + BUFSIZE * 2); ts->buf1 = (char *)(&ts[1]); ts->buf2 = ts->buf1 + BUFSIZE; #ifdef CONFIG_FEATURE_TELNETD_INETD - ts->sockfd_read = 0; ts->sockfd_write = 1; #else /* CONFIG_FEATURE_TELNETD_INETD */ ts->sockfd = sockfd; #endif /* CONFIG_FEATURE_TELNETD_INETD */ - ts->rdidx1 = ts->wridx1 = ts->size1 = 0; - ts->rdidx2 = ts->wridx2 = ts->size2 = 0; - /* Got a new connection, set up a tty and spawn a shell. */ pty = getpty(tty_name); -- cgit v1.2.3