Mercurial > pidgin
comparison src/sslconn.c @ 13986:8a8b4f7f7d99
[gaim-migrate @ 16556]
Fix a minor case of accessing something that had been free'd in oscar,
and some other minor cleanup. FYI "0" is a valid file descriptor,
but it will pretty much always be STDOUT, STDERR or STDIN. But I
like to check for -1 anyway, because I'm weird.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 24 Jul 2006 04:27:42 +0000 |
parents | b76c6de0c3b5 |
children | 10e8eb6a4910 |
comparison
equal
deleted
inserted
replaced
13985:a7b1d2ab9cb0 | 13986:8a8b4f7f7d99 |
---|---|
135 GaimSslErrorFunction error_func, void *data) | 135 GaimSslErrorFunction error_func, void *data) |
136 { | 136 { |
137 GaimSslConnection *gsc; | 137 GaimSslConnection *gsc; |
138 GaimSslOps *ops; | 138 GaimSslOps *ops; |
139 | 139 |
140 g_return_val_if_fail(fd > 0, NULL); | 140 g_return_val_if_fail(fd != -1, NULL); |
141 g_return_val_if_fail(func != NULL, NULL); | 141 g_return_val_if_fail(func != NULL, NULL); |
142 g_return_val_if_fail(gaim_ssl_is_supported(), NULL); | 142 g_return_val_if_fail(gaim_ssl_is_supported(), NULL); |
143 | 143 |
144 ops = gaim_ssl_get_ops(); | 144 ops = gaim_ssl_get_ops(); |
145 | 145 |
176 gaim_input_remove(gsc->inpa); | 176 gaim_input_remove(gsc->inpa); |
177 | 177 |
178 if (ops != NULL && ops->close != NULL) | 178 if (ops != NULL && ops->close != NULL) |
179 (ops->close)(gsc); | 179 (ops->close)(gsc); |
180 | 180 |
181 if (gsc->fd) | 181 if (gsc->fd != -1) |
182 close(gsc->fd); | 182 close(gsc->fd); |
183 | 183 |
184 if (gsc->host != NULL) | 184 g_free(gsc->host); |
185 g_free(gsc->host); | |
186 | |
187 g_free(gsc); | 185 g_free(gsc); |
188 } | 186 } |
189 | 187 |
190 size_t | 188 size_t |
191 gaim_ssl_read(GaimSslConnection *gsc, void *data, size_t len) | 189 gaim_ssl_read(GaimSslConnection *gsc, void *data, size_t len) |