Tests: possible NULL dereference in rotation notification test
[lttng-tools.git] / tests / regression / tools / notification / rotation.c
index ed9ae8944c29c90e2fe938291367c6af610b18a8..fb516f31f7c4efeb0fa1954f5fceade8365dac12 100644 (file)
@@ -322,10 +322,11 @@ int test_notification(
 
        location_status = lttng_trace_archive_location_local_get_absolute_path(
                        location, &chunk_path);
-       ok(location_status == LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK,
+       ok(location_status == LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK && chunk_path,
                        "Retrieved path from location returned by the session rotation completed notification");
        diag("Chunk available at %s", chunk_path ? chunk_path : "NULL");
-       ok(!strncmp(session->output_path, chunk_path, strlen(session->output_path)),
+
+       ok(chunk_path && !strncmp(session->output_path, chunk_path, strlen(session->output_path)),
                        "Returned path from location starts with the output path");
 
 end:
@@ -373,9 +374,6 @@ int main(int argc, const char *argv[])
        session.output_path = argv[2];
 
        plan_tests(TEST_COUNT);
-       if (ret) {
-               goto error;
-       }
 
        notification_channel = lttng_notification_channel_create(
                        lttng_session_daemon_notification_endpoint);
This page took 0.025373 seconds and 5 git commands to generate.