aboutsummaryrefslogtreecommitdiff
path: root/tests/include
diff options
context:
space:
mode:
Diffstat (limited to 'tests/include')
-rw-r--r--tests/include/testing.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/include/testing.h b/tests/include/testing.h
index 5ff847b..ab24115 100644
--- a/tests/include/testing.h
+++ b/tests/include/testing.h
@@ -92,9 +92,10 @@ inline char *stasis_testing_read_ascii(const char *filename) {
return NULL;
}
- char *result;
+ char *result = NULL;
result = calloc(st.st_size + 1, sizeof(*result));
if (fread(result, sizeof(*result), st.st_size, fp) < 1) {
+ guard_free(result);
perror(filename);
fclose(fp);
return NULL;