static int test_exec(const struct test* t) {
struct pakfire_jail* jail = NULL;
+ int r = EXIT_FAILURE;
char* output = NULL;
size_t length = 0;
// Destroy it
ASSERT_NULL(pakfire_jail_unref(jail));
- return EXIT_SUCCESS;
+ // Success
+ r = EXIT_SUCCESS;
FAIL:
- return EXIT_FAILURE;
+ if (output)
+ free(output);
+
+ return r;
}
static int test_launch_into_cgroup(const struct test* t) {
// On dequeue we should now miss Line 1, but get Line 2 instead
ASSERT_SUCCESS(pakfire_log_buffer_dequeue(buffer, ×tamp, &priority, &line, &length));
ASSERT_STRING_EQUALS(line, "Line 2");
+ free(line);
// On the next iteration, we should get Line 3
ASSERT_SUCCESS(pakfire_log_buffer_dequeue(buffer, ×tamp, &priority, &line, &length));
ASSERT_STRING_EQUALS(line, "Line 3");
+ free(line);
// On the next iteration, the buffer should be empty
ASSERT_SUCCESS(pakfire_log_buffer_dequeue(buffer, ×tamp, &priority, &line, &length));