summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2000-02-05 10:13:13 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2000-02-05 10:13:13 +0000
commit5fe1b5dc9cdb6c26282a90e96a69433d16177961 (patch)
tree6362c8f357d33fbf1f9a8b259200353eed5a8cfe
parent9a652530cb1431245223c74e2f7a9503627c729d (diff)
missing xfree()
-rw-r--r--usr.bin/ssh/packet.c12
-rw-r--r--usr.bin/ssh/sshconnect.c3
-rw-r--r--usr.bin/ssh/sshd.c10
3 files changed, 17 insertions, 8 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index 1768f4ac73c..af54759233b 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -15,7 +15,7 @@
*/
#include "includes.h"
-RCSID("$Id: packet.c,v 1.21 2000/01/22 20:20:28 deraadt Exp $");
+RCSID("$Id: packet.c,v 1.22 2000/02/05 10:13:11 markus Exp $");
#include "xmalloc.h"
#include "buffer.h"
@@ -505,7 +505,7 @@ packet_read_poll(int *payload_len_ptr)
{
unsigned int len, padded_len;
unsigned char *ucp;
- char buf[8], *cp;
+ char buf[8], *cp, *msg;
unsigned int checksum, stored_checksum;
restart:
@@ -575,7 +575,9 @@ restart:
/* Handle disconnect message. */
if ((unsigned char) buf[0] == SSH_MSG_DISCONNECT) {
- log("Received disconnect: %.900s", packet_get_string(NULL));
+ msg = packet_get_string(NULL);
+ log("Received disconnect: %.900s", msg);
+ xfree(msg);
fatal_cleanup();
}
@@ -585,7 +587,9 @@ restart:
/* Send debug messages as debugging output. */
if ((unsigned char) buf[0] == SSH_MSG_DEBUG) {
- debug("Remote: %.900s", packet_get_string(NULL));
+ msg = packet_get_string(NULL);
+ debug("Remote: %.900s", msg);
+ xfree(msg);
goto restart;
}
/* Return type. */
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index ac8f4937143..80963ba9643 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -8,7 +8,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.53 2000/01/18 09:42:17 markus Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.54 2000/02/05 10:13:11 markus Exp $");
#include <ssl/bn.h>
#include "xmalloc.h"
@@ -885,6 +885,7 @@ try_skey_authentication()
log("WARNING: Encryption is disabled! "
"Reponse will be transmitted in clear text.");
fprintf(stderr, "%s\n", challenge);
+ xfree(challenge);
fflush(stderr);
for (i = 0; i < options.number_of_password_prompts; i++) {
if (i != 0)
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index c54fa66ab43..6f63b404585 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -1,4 +1,4 @@
-/*
+
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -11,7 +11,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.84 2000/02/01 13:52:26 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.85 2000/02/05 10:13:12 markus Exp $");
#include "xmalloc.h"
#include "rsa.h"
@@ -1186,6 +1186,7 @@ do_authentication()
pw = getpwnam(user);
if (!pw || !allowed_user(pw))
do_fake_authloop(user);
+ xfree(user);
/* Take a copy of the returned structure. */
memset(&pwcopy, 0, sizeof(pwcopy));
@@ -1204,7 +1205,7 @@ do_authentication()
if (getuid() != 0 && pw->pw_uid != getuid())
packet_disconnect("Cannot change user when server not running as root.");
- debug("Attempting authentication for %.100s.", user);
+ debug("Attempting authentication for %.100s.", pw->pw_name);
/* If the user has no password, accept authentication immediately. */
if (options.password_authentication &&
@@ -1527,6 +1528,7 @@ do_fake_authloop(char *user)
/* Try to send a fake s/key challenge. */
if (options.skey_authentication == 1 &&
(skeyinfo = skey_fake_keyinfo(user)) != NULL) {
+ password = NULL;
if (type == SSH_CMSG_AUTH_TIS) {
packet_start(SSH_SMSG_AUTH_TIS_CHALLENGE);
packet_put_string(skeyinfo, strlen(skeyinfo));
@@ -1540,6 +1542,8 @@ do_fake_authloop(char *user)
strncasecmp(password, "s/key", 5) == 0 ) {
packet_send_debug(skeyinfo);
}
+ if (password != NULL)
+ xfree(password);
}
#endif
if (attempt > AUTH_FAIL_MAX)