[sshconnect2.c]
     Fix memory leaks found by Zhenbo Xu and the Melton tool.  bz#1967, ok djm
This commit is contained in:
Darren Tucker 2013-06-06 08:22:05 +10:00
parent 0cca17fa18
commit e52a260f16
2 changed files with 9 additions and 2 deletions

View File

@ -40,6 +40,9 @@
When running sshd -D, close stderr unless we have explicitly requesting
logging to stderr. From james.hunt at ubuntu.com via bz#1976, djm's patch
so, err, ok dtucker.
- dtucker@cvs.openbsd.org 2013/06/05 12:52:38
[sshconnect2.c]
Fix memory leaks found by Zhenbo Xu and the Melton tool. bz#1967, ok djm
20130602
- (tim) [Makefile.in] Make Solaris, UnixWare, & OpenServer linkers happy

View File

@ -1,4 +1,4 @@
/* $OpenBSD: sshconnect2.c,v 1.197 2013/05/17 00:13:14 djm Exp $ */
/* $OpenBSD: sshconnect2.c,v 1.198 2013/06/05 12:52:38 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@ -1322,8 +1322,11 @@ load_identity_file(char *filename, int userprovided)
return NULL;
}
private = key_load_private_type(KEY_UNSPEC, filename, "", NULL, &perm_ok);
if (!perm_ok)
if (!perm_ok) {
if (private != NULL)
key_free(private);
return NULL;
}
if (private == NULL) {
if (options.batch_mode)
return NULL;
@ -1915,6 +1918,7 @@ authmethod_get(char *authlist)
free(name);
return current;
}
free(name);
}
}