Bugzilla – Attachment 2124 Details for
Bug 1967
Potential memory leak in ssh [detected by melton]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix memory leaks
openssh-leakfix.patch (text/plain), 2.48 KB, created by
Darren Tucker
on 2011-12-30 20:57:22 AEDT
(
hide
)
Description:
fix memory leaks
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2011-12-30 20:57:22 AEDT
Size:
2.48 KB
patch
obsolete
>Index: mux.c >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/mux.c,v >retrieving revision 1.35 >diff -u -p -r1.35 mux.c >--- mux.c 18 Dec 2011 23:52:21 -0000 1.35 >+++ mux.c 30 Dec 2011 09:19:51 -0000 >@@ -292,6 +292,8 @@ process_mux_master_hello(u_int rid, Chan > if (name == NULL || value == NULL) { > if (name != NULL) > xfree(name); >+ if (value != NULL) >+ xfree(value); > goto malf; > } > debug2("Unrecognised slave extension \"%s\"", name); >@@ -331,6 +333,7 @@ process_mux_new_session(u_int rid, Chann > xfree(reserved); > if (cctx->term != NULL) > xfree(cctx->term); >+ xfree(cctx); > error("%s: malformed message", __func__); > return -1; > } >@@ -1446,6 +1449,7 @@ mux_client_read_packet(int fd, Buffer *m > if ((oerrno = errno) == EPIPE) > debug3("%s: read header failed: %s", __func__, strerror(errno)); > errno = oerrno; >+ buffer_free(&queue); > return -1; > } > need = get_u32(buffer_ptr(&queue)); >@@ -1453,6 +1457,7 @@ mux_client_read_packet(int fd, Buffer *m > oerrno = errno; > debug3("%s: read body failed: %s", __func__, strerror(errno)); > errno = oerrno; >+ buffer_free(&queue); > return -1; > } > ptr = buffer_get_string_ptr(&queue, &have); >Index: readconf.c >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/readconf.c,v >retrieving revision 1.174 >diff -u -p -r1.174 readconf.c >--- readconf.c 2 Oct 2011 07:59:03 -0000 1.174 >+++ readconf.c 30 Dec 2011 09:42:23 -0000 >@@ -1063,6 +1063,8 @@ parse_int: > fatal("%.200s line %d: garbage at end of line; \"%.200s\".", > filename, linenum, arg); > } >+ if (arg != NULL) >+ xfree(arg); > return 0; > } > >Index: sshconnect2.c >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/sshconnect2.c,v >retrieving revision 1.180 >diff -u -p -r1.180 sshconnect2.c >--- sshconnect2.c 29 May 2011 11:42:34 -0000 1.180 >+++ sshconnect2.c 30 Dec 2011 09:27:33 -0000 >@@ -1323,8 +1323,11 @@ load_identity_file(char *filename) > 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; >@@ -1892,9 +1895,9 @@ authmethod_get(char *authlist) > xfree(name); > return current; > } >+ if (name != NULL) >+ xfree(name); > } >- if (name != NULL) >- xfree(name); > } > > static char *
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1967
: 2124