Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Cursor): fix a memory leak detected by valgrind #641

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

apocelipes
Copy link
Contributor

No description provided.

@CarterLi
Copy link
Member

CarterLi commented Dec 1, 2023

I prefer

    if (result.error.length)
    {
        yyjson_mut_obj_add_strbuf(doc, module, "error", &result.error);
    }
    else
    {
        yyjson_mut_val* obj = yyjson_mut_obj_add_obj(doc, module, "result");
        yyjson_mut_obj_add_strbuf(doc, obj, "theme", &result.theme);
        yyjson_mut_obj_add_strbuf(doc, obj, "size", &result.size);
    }

@apocelipes
Copy link
Contributor Author

if (result.error.length)
    {
        yyjson_mut_obj_add_strbuf(doc, module, "error", &result.error);
    }
    else
    {
        yyjson_mut_val* obj = yyjson_mut_obj_add_obj(doc, module, "result");
        yyjson_mut_obj_add_strbuf(doc, obj, "theme", &result.theme);
        yyjson_mut_obj_add_strbuf(doc, obj, "size", &result.size);
    }

I agree. Fixed.

@CarterLi CarterLi merged commit c398dc6 into fastfetch-cli:dev Dec 1, 2023
18 checks passed
@apocelipes apocelipes deleted the fix-cursor branch December 1, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants