diff options
author | Darren Tucker <dtucker@zip.com.au> | 2013-06-02 07:31:17 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2013-06-02 07:31:17 +1000 |
commit | a627d42e51ffa71e014d7b2d2c07118122fd3ec3 (patch) | |
tree | 7bda769de81f509e28d800916fa20abd37906d79 /serverloop.c | |
parent | c7aad0058c957afeb26a3f703e8cb0eddeb62365 (diff) |
- djm@cvs.openbsd.org 2013/05/17 00:13:13
[xmalloc.h cipher.c sftp-glob.c ssh-keyscan.c ssh.c sftp-common.c
ssh-ecdsa.c auth2-chall.c compat.c readconf.c kexgexs.c monitor.c
gss-genr.c cipher-3des1.c kex.c monitor_wrap.c ssh-pkcs11-client.c
auth-options.c rsa.c auth2-pubkey.c sftp.c hostfile.c auth2.c
servconf.c auth.c authfile.c xmalloc.c uuencode.c sftp-client.c
auth2-gss.c sftp-server.c bufaux.c mac.c session.c jpake.c kexgexc.c
sshconnect.c auth-chall.c auth2-passwd.c sshconnect1.c buffer.c
kexecdhs.c kexdhs.c ssh-rsa.c auth1.c ssh-pkcs11.c auth2-kbdint.c
kexdhc.c sshd.c umac.c ssh-dss.c auth2-jpake.c bufbn.c clientloop.c
monitor_mm.c scp.c roaming_client.c serverloop.c key.c auth-rsa.c
ssh-pkcs11-helper.c ssh-keysign.c ssh-keygen.c match.c channels.c
sshconnect2.c addrmatch.c mux.c canohost.c kexecdhc.c schnorr.c
ssh-add.c misc.c auth2-hostbased.c ssh-agent.c bufec.c groupaccess.c
dns.c packet.c readpass.c authfd.c moduli.c]
bye, bye xfree(); ok markus@
Diffstat (limited to 'serverloop.c')
-rw-r--r-- | serverloop.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/serverloop.c b/serverloop.c index a61d4ad32..7c250b22f 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: serverloop.c,v 1.166 2013/05/16 09:08:41 dtucker Exp $ */ | 1 | /* $OpenBSD: serverloop.c,v 1.167 2013/05/17 00:13:14 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -694,7 +694,7 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg) | |||
694 | /* Display list of open channels. */ | 694 | /* Display list of open channels. */ |
695 | cp = channel_open_message(); | 695 | cp = channel_open_message(); |
696 | buffer_append(&stderr_buffer, cp, strlen(cp)); | 696 | buffer_append(&stderr_buffer, cp, strlen(cp)); |
697 | xfree(cp); | 697 | free(cp); |
698 | } | 698 | } |
699 | } | 699 | } |
700 | max_fd = MAX(connection_in, connection_out); | 700 | max_fd = MAX(connection_in, connection_out); |
@@ -722,10 +722,8 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg) | |||
722 | /* Process output to the client and to program stdin. */ | 722 | /* Process output to the client and to program stdin. */ |
723 | process_output(writeset); | 723 | process_output(writeset); |
724 | } | 724 | } |
725 | if (readset) | 725 | free(readset); |
726 | xfree(readset); | 726 | free(writeset); |
727 | if (writeset) | ||
728 | xfree(writeset); | ||
729 | 727 | ||
730 | /* Cleanup and termination code. */ | 728 | /* Cleanup and termination code. */ |
731 | 729 | ||
@@ -885,10 +883,8 @@ server_loop2(Authctxt *authctxt) | |||
885 | } | 883 | } |
886 | collect_children(); | 884 | collect_children(); |
887 | 885 | ||
888 | if (readset) | 886 | free(readset); |
889 | xfree(readset); | 887 | free(writeset); |
890 | if (writeset) | ||
891 | xfree(writeset); | ||
892 | 888 | ||
893 | /* free all channels, no more reads and writes */ | 889 | /* free all channels, no more reads and writes */ |
894 | channel_free_all(); | 890 | channel_free_all(); |
@@ -923,7 +919,7 @@ server_input_stdin_data(int type, u_int32_t seq, void *ctxt) | |||
923 | packet_check_eom(); | 919 | packet_check_eom(); |
924 | buffer_append(&stdin_buffer, data, data_len); | 920 | buffer_append(&stdin_buffer, data, data_len); |
925 | memset(data, 0, data_len); | 921 | memset(data, 0, data_len); |
926 | xfree(data); | 922 | free(data); |
927 | } | 923 | } |
928 | 924 | ||
929 | static void | 925 | static void |
@@ -980,8 +976,8 @@ server_request_direct_tcpip(void) | |||
980 | originator, originator_port, target, target_port); | 976 | originator, originator_port, target, target_port); |
981 | } | 977 | } |
982 | 978 | ||
983 | xfree(originator); | 979 | free(originator); |
984 | xfree(target); | 980 | free(target); |
985 | 981 | ||
986 | return c; | 982 | return c; |
987 | } | 983 | } |
@@ -1110,7 +1106,7 @@ server_input_channel_open(int type, u_int32_t seq, void *ctxt) | |||
1110 | } | 1106 | } |
1111 | packet_send(); | 1107 | packet_send(); |
1112 | } | 1108 | } |
1113 | xfree(ctype); | 1109 | free(ctype); |
1114 | } | 1110 | } |
1115 | 1111 | ||
1116 | static void | 1112 | static void |
@@ -1155,7 +1151,7 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt) | |||
1155 | listen_address, listen_port, | 1151 | listen_address, listen_port, |
1156 | &allocated_listen_port, options.gateway_ports); | 1152 | &allocated_listen_port, options.gateway_ports); |
1157 | } | 1153 | } |
1158 | xfree(listen_address); | 1154 | free(listen_address); |
1159 | } else if (strcmp(rtype, "cancel-tcpip-forward") == 0) { | 1155 | } else if (strcmp(rtype, "cancel-tcpip-forward") == 0) { |
1160 | char *cancel_address; | 1156 | char *cancel_address; |
1161 | u_short cancel_port; | 1157 | u_short cancel_port; |
@@ -1167,7 +1163,7 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt) | |||
1167 | 1163 | ||
1168 | success = channel_cancel_rport_listener(cancel_address, | 1164 | success = channel_cancel_rport_listener(cancel_address, |
1169 | cancel_port); | 1165 | cancel_port); |
1170 | xfree(cancel_address); | 1166 | free(cancel_address); |
1171 | } else if (strcmp(rtype, "no-more-sessions@openssh.com") == 0) { | 1167 | } else if (strcmp(rtype, "no-more-sessions@openssh.com") == 0) { |
1172 | no_more_sessions = 1; | 1168 | no_more_sessions = 1; |
1173 | success = 1; | 1169 | success = 1; |
@@ -1180,7 +1176,7 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt) | |||
1180 | packet_send(); | 1176 | packet_send(); |
1181 | packet_write_wait(); | 1177 | packet_write_wait(); |
1182 | } | 1178 | } |
1183 | xfree(rtype); | 1179 | free(rtype); |
1184 | } | 1180 | } |
1185 | 1181 | ||
1186 | static void | 1182 | static void |
@@ -1212,7 +1208,7 @@ server_input_channel_req(int type, u_int32_t seq, void *ctxt) | |||
1212 | packet_put_int(c->remote_id); | 1208 | packet_put_int(c->remote_id); |
1213 | packet_send(); | 1209 | packet_send(); |
1214 | } | 1210 | } |
1215 | xfree(rtype); | 1211 | free(rtype); |
1216 | } | 1212 | } |
1217 | 1213 | ||
1218 | static void | 1214 | static void |