Skip to content

Potential dangling pointer in od_backend_connect_to #970

Description

@arpit-saxena

In the code below in od_backend_connect_to, we free io pointer and return.

odyssey/sources/backend.c

Lines 311 to 318 in 8bd0ada

rc = od_io_prepare(&server->io, io, instance->config.readahead);
if (rc == -1) {
od_error(&instance->logger, context, NULL, server,
"failed to set server io");
machine_close(io);
machine_io_free(io);
return -1;
}

This causes server->io.io to be a dangling pointer, pointing to freed up memory. This can cause issues when we try to access this pointer when doing cleanup after this error. I believe we should set this to NULL after freeing it atleast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions