Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generalise zqueue to non-string data pointers, fix memory leaks (#806)
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.
- Loading branch information
Showing
3 changed files
with
10 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters