aboutsummaryrefslogtreecommitdiff
path: root/tests/test_copy.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2025-02-04 13:06:11 -0500
committerGitHub <noreply@github.com>2025-02-04 13:06:11 -0500
commit89bd28eb5ac263d1753021f25e1bc62f48e7008d (patch)
tree622918f9a81723b830ab8bcc403154271932b591 /tests/test_copy.c
parent2372e40c40ef7bc85176d8998272ad75a59fcf05 (diff)
parent825aa472739775a5e2d673043f9d846df1eac924 (diff)
downloadstasis-89bd28eb5ac263d1753021f25e1bc62f48e7008d.tar.gz
Merge pull request #86 from jhunkeler/memfixes
ASAN: Fix leaks
Diffstat (limited to 'tests/test_copy.c')
-rw-r--r--tests/test_copy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_copy.c b/tests/test_copy.c
index 14310e4..b37b1d3 100644
--- a/tests/test_copy.c
+++ b/tests/test_copy.c
@@ -18,7 +18,7 @@ void test_copy() {
for (size_t i = 0; i < sizeof(tc) / sizeof(*tc); i++) {
struct stat st_a, st_b;
struct testcase *test = &tc[i];
- char *mock_data = malloc(test->expect_size * sizeof(*mock_data));
+ char *mock_data = malloc(test->expect_size + 1 * sizeof(*mock_data));
memset(mock_data, 'A', test->expect_size);
mock_data[test->expect_size] = '\0';
stasis_testing_write_ascii(test->in_file, mock_data);