test: fix valgrind definite leak in forked compression truncation test
CI / lint (push) Successful in 1m24s
CI / sanitizers (undefined) (push) Successful in 1m1s
CI / sanitizers (address) (push) Successful in 1m6s
CI / fuzz-build (push) Successful in 35s
CI / coverage (push) Successful in 55s
CI / valgrind (push) Successful in 3m18s
CI / build-and-test (push) Successful in 5m25s

This commit is contained in:
2026-09-14 17:54:20 +02:00
+4
View File
@@ -295,9 +295,13 @@ static void test_data_decompress_truncated_frame_fails() {
bool failed_cleanly = (out == NULL); bool failed_cleanly = (out == NULL);
data_destroy(out); data_destroy(out);
data_destroy(compressed); data_destroy(compressed);
/* The child inherited `input` across fork(); free it before _exit so the
* valgrind CI job (which instruments forked children too) sees no leak. */
data_destroy(input);
_exit(failed_cleanly ? 0 : 1); _exit(failed_cleanly ? 0 : 1);
} }
data_destroy(compressed); data_destroy(compressed);
data_destroy(input);
_exit(2); _exit(2);
} }
int status; int status;