aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/include/testing.h3
-rw-r--r--tests/test_utils.c1
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/include/testing.h b/tests/include/testing.h
index 6fa5ca6..80d5aa2 100644
--- a/tests/include/testing.h
+++ b/tests/include/testing.h
@@ -115,8 +115,7 @@ inline char *stasis_testing_read_ascii(const char *filename) {
}
inline int stasis_testing_write_ascii(const char *filename, const char *data) {
- FILE *fp;
- fp = fopen(filename, "w+");
+ FILE *fp = fopen(filename, "w+");
if (!fp) {
perror(filename);
return -1;
diff --git a/tests/test_utils.c b/tests/test_utils.c
index 7361139..a5faf5c 100644
--- a/tests/test_utils.c
+++ b/tests/test_utils.c
@@ -279,6 +279,7 @@ void test_file_readlines() {
}
if (fwrite(data, sizeof(*data), strlen(data), fp) != strlen(data)) {
perror("short write");
+ fclose(fp);
return;
}
fclose(fp);