diff options
author | Darren Tucker <dtucker@zip.com.au> | 2013-06-06 08:22:05 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2013-06-06 08:22:05 +1000 |
commit | e52a260f16888ca75390f97de4606943e61785e8 (patch) | |
tree | 96f675ca426513f2ce1291f9f26643de097a6757 | |
parent | 0cca17fa1819d3a0ba06a6db41ab3eaa8d769587 (diff) |
- 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
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | sshconnect2.c | 8 |
2 files changed, 9 insertions, 2 deletions
@@ -40,6 +40,9 @@ | |||
40 | When running sshd -D, close stderr unless we have explicitly requesting | 40 | When running sshd -D, close stderr unless we have explicitly requesting |
41 | logging to stderr. From james.hunt at ubuntu.com via bz#1976, djm's patch | 41 | logging to stderr. From james.hunt at ubuntu.com via bz#1976, djm's patch |
42 | so, err, ok dtucker. | 42 | so, err, ok dtucker. |
43 | - dtucker@cvs.openbsd.org 2013/06/05 12:52:38 | ||
44 | [sshconnect2.c] | ||
45 | Fix memory leaks found by Zhenbo Xu and the Melton tool. bz#1967, ok djm | ||
43 | 46 | ||
44 | 20130602 | 47 | 20130602 |
45 | - (tim) [Makefile.in] Make Solaris, UnixWare, & OpenServer linkers happy | 48 | - (tim) [Makefile.in] Make Solaris, UnixWare, & OpenServer linkers happy |
diff --git a/sshconnect2.c b/sshconnect2.c index 19ed3459f..70e3cd8c9 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect2.c,v 1.197 2013/05/17 00:13:14 djm Exp $ */ | 1 | /* $OpenBSD: sshconnect2.c,v 1.198 2013/06/05 12:52:38 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2008 Damien Miller. All rights reserved. | 4 | * Copyright (c) 2008 Damien Miller. All rights reserved. |
@@ -1322,8 +1322,11 @@ load_identity_file(char *filename, int userprovided) | |||
1322 | return NULL; | 1322 | return NULL; |
1323 | } | 1323 | } |
1324 | private = key_load_private_type(KEY_UNSPEC, filename, "", NULL, &perm_ok); | 1324 | private = key_load_private_type(KEY_UNSPEC, filename, "", NULL, &perm_ok); |
1325 | if (!perm_ok) | 1325 | if (!perm_ok) { |
1326 | if (private != NULL) | ||
1327 | key_free(private); | ||
1326 | return NULL; | 1328 | return NULL; |
1329 | } | ||
1327 | if (private == NULL) { | 1330 | if (private == NULL) { |
1328 | if (options.batch_mode) | 1331 | if (options.batch_mode) |
1329 | return NULL; | 1332 | return NULL; |
@@ -1915,6 +1918,7 @@ authmethod_get(char *authlist) | |||
1915 | free(name); | 1918 | free(name); |
1916 | return current; | 1919 | return current; |
1917 | } | 1920 | } |
1921 | free(name); | ||
1918 | } | 1922 | } |
1919 | } | 1923 | } |
1920 | 1924 | ||