Skip to content

Does ecc_set_curve need a counterpart ecc_free? #710

@zwhfly

Description

@zwhfly

The documentation of ecc_set_curve and ecc_free have no mention of each other now.
But the following code leaks memory:

    ltc_ecc_curve const * cu = 0;
    if (CRYPT_OK != ecc_find_curve("P-256", &cu))
        return;
    for (unsigned i = 0; i < 100000000; ++i)
    {
        ecc_key key;
        if (CRYPT_OK != ecc_set_curve(cu, &key))
            return;
    }

Should I call ecc_free after a successful ecc_set_curve followed by a failed ecc_set_key .etc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions