diff options
Diffstat (limited to 'src/testcurl/https/tls_multi_thread_mode_test.c')
-rw-r--r-- | src/testcurl/https/tls_multi_thread_mode_test.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/testcurl/https/tls_multi_thread_mode_test.c b/src/testcurl/https/tls_multi_thread_mode_test.c index e0c0a304..eeb5e8a0 100644 --- a/src/testcurl/https/tls_multi_thread_mode_test.c +++ b/src/testcurl/https/tls_multi_thread_mode_test.c | |||
@@ -163,44 +163,39 @@ test_https_transfer (FILE * test_fd, char *cipher_suite, int proto_version) | |||
163 | doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX; | 163 | doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX; |
164 | if (NULL == (doc_path = malloc (doc_path_len))) | 164 | if (NULL == (doc_path = malloc (doc_path_len))) |
165 | { | 165 | { |
166 | fclose (test_fd); | ||
167 | fprintf (stderr, MHD_E_MEM); | 166 | fprintf (stderr, MHD_E_MEM); |
168 | return -1; | 167 | return -1; |
169 | } | 168 | } |
170 | if (getcwd (doc_path, doc_path_len) == NULL) | 169 | if (getcwd (doc_path, doc_path_len) == NULL) |
171 | { | 170 | { |
172 | fclose (test_fd); | ||
173 | free (doc_path); | ||
174 | fprintf (stderr, "Error: failed to get working directory. %s\n", | 171 | fprintf (stderr, "Error: failed to get working directory. %s\n", |
175 | strerror (errno)); | 172 | strerror (errno)); |
173 | free (doc_path); | ||
176 | return -1; | 174 | return -1; |
177 | } | 175 | } |
178 | 176 | ||
179 | if (NULL == (mem_test_file_local = malloc (len))) | 177 | if (NULL == (mem_test_file_local = malloc (len))) |
180 | { | 178 | { |
181 | fclose (test_fd); | ||
182 | free (doc_path); | ||
183 | fprintf (stderr, MHD_E_MEM); | 179 | fprintf (stderr, MHD_E_MEM); |
180 | free (doc_path); | ||
184 | return -1; | 181 | return -1; |
185 | } | 182 | } |
186 | 183 | ||
187 | fseek (test_fd, 0, SEEK_SET); | 184 | fseek (test_fd, 0, SEEK_SET); |
188 | if (fread (mem_test_file_local, sizeof (char), len, test_fd) != len) | 185 | if (fread (mem_test_file_local, sizeof (char), len, test_fd) != len) |
189 | { | 186 | { |
190 | fclose (test_fd); | ||
191 | free (doc_path); | ||
192 | free (mem_test_file_local); | ||
193 | fprintf (stderr, "Error: failed to read test file. %s\n", | 187 | fprintf (stderr, "Error: failed to read test file. %s\n", |
194 | strerror (errno)); | 188 | strerror (errno)); |
189 | free (doc_path); | ||
190 | free (mem_test_file_local); | ||
195 | return -1; | 191 | return -1; |
196 | } | 192 | } |
197 | 193 | ||
198 | if (NULL == (cbc.buf = malloc (len))) | 194 | if (NULL == (cbc.buf = malloc (len))) |
199 | { | 195 | { |
200 | fclose (test_fd); | 196 | fprintf (stderr, MHD_E_MEM); |
201 | free (doc_path); | 197 | free (doc_path); |
202 | free (mem_test_file_local); | 198 | free (mem_test_file_local); |
203 | fprintf (stderr, MHD_E_MEM); | ||
204 | return -1; | 199 | return -1; |
205 | } | 200 | } |
206 | cbc.size = len; | 201 | cbc.size = len; |
@@ -299,12 +294,14 @@ setupTestFile () | |||
299 | { | 294 | { |
300 | fprintf (stderr, "Error: failed to write `%s. %s'\n", | 295 | fprintf (stderr, "Error: failed to write `%s. %s'\n", |
301 | test_file_name, strerror (errno)); | 296 | test_file_name, strerror (errno)); |
297 | fclose (test_fd); | ||
302 | return NULL; | 298 | return NULL; |
303 | } | 299 | } |
304 | if (fflush (test_fd)) | 300 | if (fflush (test_fd)) |
305 | { | 301 | { |
306 | fprintf (stderr, "Error: failed to flush test file stream. %s\n", | 302 | fprintf (stderr, "Error: failed to flush test file stream. %s\n", |
307 | strerror (errno)); | 303 | strerror (errno)); |
304 | fclose (test_fd); | ||
308 | return NULL; | 305 | return NULL; |
309 | } | 306 | } |
310 | 307 | ||
@@ -453,6 +450,7 @@ main (int argc, char *const *argv) | |||
453 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 450 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
454 | { | 451 | { |
455 | fprintf (stderr, "Error: %s\n", strerror (errno)); | 452 | fprintf (stderr, "Error: %s\n", strerror (errno)); |
453 | fclose (test_fd); | ||
456 | return -1; | 454 | return -1; |
457 | } | 455 | } |
458 | 456 | ||