aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/https/mhds_multi_daemon_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/https/mhds_multi_daemon_test.c')
-rw-r--r--src/testcurl/https/mhds_multi_daemon_test.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/testcurl/https/mhds_multi_daemon_test.c b/src/testcurl/https/mhds_multi_daemon_test.c
index b462cdd7..69598d8f 100644
--- a/src/testcurl/https/mhds_multi_daemon_test.c
+++ b/src/testcurl/https/mhds_multi_daemon_test.c
@@ -143,13 +143,11 @@ test_daemon_get (FILE * test_fd, char *cipher_suite, int proto_version,
143 doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX; 143 doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX;
144 if (NULL == (doc_path = malloc (doc_path_len))) 144 if (NULL == (doc_path = malloc (doc_path_len)))
145 { 145 {
146 fclose (test_fd);
147 fprintf (stderr, MHD_E_MEM); 146 fprintf (stderr, MHD_E_MEM);
148 return -1; 147 return -1;
149 } 148 }
150 if (getcwd (doc_path, doc_path_len) == NULL) 149 if (getcwd (doc_path, doc_path_len) == NULL)
151 { 150 {
152 fclose (test_fd);
153 free (doc_path); 151 free (doc_path);
154 fprintf (stderr, "Error: failed to get working directory. %s\n", 152 fprintf (stderr, "Error: failed to get working directory. %s\n",
155 strerror (errno)); 153 strerror (errno));
@@ -160,7 +158,6 @@ test_daemon_get (FILE * test_fd, char *cipher_suite, int proto_version,
160 fseek (test_fd, 0, SEEK_SET); 158 fseek (test_fd, 0, SEEK_SET);
161 if (fread (mem_test_file_local, sizeof (char), len, test_fd) != len) 159 if (fread (mem_test_file_local, sizeof (char), len, test_fd) != len)
162 { 160 {
163 fclose (test_fd);
164 fprintf (stderr, "Error: failed to read test file. %s\n", 161 fprintf (stderr, "Error: failed to read test file. %s\n",
165 strerror (errno)); 162 strerror (errno));
166 return -1; 163 return -1;
@@ -168,7 +165,6 @@ test_daemon_get (FILE * test_fd, char *cipher_suite, int proto_version,
168 165
169 if (NULL == (cbc.buf = malloc (sizeof (char) * len))) 166 if (NULL == (cbc.buf = malloc (sizeof (char) * len)))
170 { 167 {
171 fclose (test_fd);
172 fprintf (stderr, "Error: failed to read test file. %s\n", 168 fprintf (stderr, "Error: failed to read test file. %s\n",
173 strerror (errno)); 169 strerror (errno));
174 return -1; 170 return -1;
@@ -294,12 +290,14 @@ setupTestFile ()
294 { 290 {
295 fprintf (stderr, "Error: failed to write `%s. %s'\n", 291 fprintf (stderr, "Error: failed to write `%s. %s'\n",
296 test_file_name, strerror (errno)); 292 test_file_name, strerror (errno));
293 fclose (test_fd);
297 return NULL; 294 return NULL;
298 } 295 }
299 if (fflush (test_fd)) 296 if (fflush (test_fd))
300 { 297 {
301 fprintf (stderr, "Error: failed to flush test file stream. %s\n", 298 fprintf (stderr, "Error: failed to flush test file stream. %s\n",
302 strerror (errno)); 299 strerror (errno));
300 fclose (test_fd);
303 return NULL; 301 return NULL;
304 } 302 }
305 303
@@ -327,6 +325,7 @@ main (int argc, char *const *argv)
327 { 325 {
328 fprintf (stderr, "Error (code: %u). l:%d f:%s\n", errorCount, __LINE__, 326 fprintf (stderr, "Error (code: %u). l:%d f:%s\n", errorCount, __LINE__,
329 __FUNCTION__); 327 __FUNCTION__);
328 fclose (test_fd);
330 return -1; 329 return -1;
331 } 330 }
332 331