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

Checked versions of memory allocating functions #75

Open
obiwac opened this issue Nov 21, 2024 · 0 comments
Open

Checked versions of memory allocating functions #75

obiwac opened this issue Nov 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@obiwac
Copy link
Member

obiwac commented Nov 21, 2024

The codebase makes a lot of use of the following pattern, where allocations are just asserted to have succeeded:

char* CLEANUP_STR parent_backing = strdup(val);
assert(parent_backing != NULL);

I could totally have a strdup_checked or maybe strdup_c function (and equivalents for realloc and calloc and malloc etc etc) to not repeat myself.

@obiwac obiwac added the enhancement New feature or request label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant