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

Generalise zqueue to non-string data pointers, fix memory leaks #806

Merged
merged 1 commit into from Mar 4, 2024

Conversation

droe
Copy link
Contributor

@droe droe commented Mar 3, 2024

Make zqueue store a void * instead of a char *.

Remove internal strdup of data ptr in push_back; instead, take ownership of the pointer and move the strdup to the callsite in ztee.

This also fixes a one-off memory leak in ztee where first_line was never freed after getting pushed onto the queue.

While here, fix memory leaks in the unused get_front and get_back functions.

Generalisation of zqueue motivated by wanting to use zqueue for droe/netmap-arp.

Make zqueue store a void * instead of a char *.

Remove internal strdup of data ptr in push_back; instead, take ownership
of the pointer and move the strdup to the callsite in ztee.

This also fixes a one-off memory leak in ztee where first_line was never
freed after getting pushed onto the queue.

While here, fix memory leaks in the unused get_front and get_back
functions.
@zakird zakird merged commit 060cff8 into zmap:main Mar 4, 2024
7 checks passed
@droe droe deleted the droe/fix-zqueue branch March 11, 2024 08:01
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.

None yet

2 participants