Skip to content

Allocate space for input in text indexes. #1

Description

@anuragkh

Currently, the text index data-structures hold on to references of the input data (const char *) that they are passed. Once the original data is destroyed, the data-structures begin to mal-function since the reference it's holding on to points to data that may no longer exist.

A simple solution is to copy the entire input data to a newly allocated buffer within each of the data-structures. The responsibility of freeing the original input buffer would lie with the caller, and the responsibility of freeing the new copy would lie with the text-index data-structure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions