comparison svr-session.c @ 1069:2fa71c3b2827 pam

merge pam branch up to date
author Matt Johnston <matt@ucc.asn.au>
date Mon, 16 Mar 2015 21:34:05 +0800
parents 73ea0dce9a57 3fb883a6aa81
children 16379795f80b
comparison
equal deleted inserted replaced
1068:9a6395ddb1b6 1069:2fa71c3b2827
79 #endif 79 #endif
80 NULL /* Null termination is mandatory. */ 80 NULL /* Null termination is mandatory. */
81 }; 81 };
82 82
83 static void 83 static void
84 svr_session_cleanup(void) 84 svr_session_cleanup(void) {
85 {
86 /* free potential public key options */ 85 /* free potential public key options */
87 svr_pubkey_options_cleanup(); 86 svr_pubkey_options_cleanup();
87
88 m_free(svr_ses.addrstring);
89 m_free(svr_ses.remotehost);
90 m_free(svr_ses.childpids);
91 svr_ses.childpidsize = 0;
88 } 92 }
89 93
90 static void 94 static void
91 svr_sessionloop() { 95 svr_sessionloop() {
92 if (svr_ses.connect_time != 0 96 if (svr_ses.connect_time != 0
151 155
152 /* failure exit - format must be <= 100 chars */ 156 /* failure exit - format must be <= 100 chars */
153 void svr_dropbear_exit(int exitcode, const char* format, va_list param) { 157 void svr_dropbear_exit(int exitcode, const char* format, va_list param) {
154 158
155 char fmtbuf[300]; 159 char fmtbuf[300];
160 int i;
156 161
157 if (!sessinitdone) { 162 if (!sessinitdone) {
158 /* before session init */ 163 /* before session init */
159 snprintf(fmtbuf, sizeof(fmtbuf), 164 snprintf(fmtbuf, sizeof(fmtbuf),
160 "Early exit: %s", format); 165 "Early exit: %s", format);
184 { 189 {
185 /* must be after we've done with username etc */ 190 /* must be after we've done with username etc */
186 session_cleanup(); 191 session_cleanup();
187 } 192 }
188 193
194 if (svr_opts.hostkey) {
195 sign_key_free(svr_opts.hostkey);
196 svr_opts.hostkey = NULL;
197 }
198 for (i = 0; i < DROPBEAR_MAX_PORTS; i++) {
199 m_free(svr_opts.addresses[i]);
200 m_free(svr_opts.ports[i]);
201 }
202
189 exit(exitcode); 203 exit(exitcode);
190 204
191 } 205 }
192 206
193 /* priority is priority as with syslog() */ 207 /* priority is priority as with syslog() */