mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-24 02:51:43 +01:00
Guillem Jover
8e2d55047c
Fix vis family of functions to not leak
The code uses an internal helper function to avoid code repetition. But to get there, the function takes a pointer to a pointer, so that the few functions that require returning an allocated buffer can get hold of it this way. The problem is that the user might pass a NULL pointer and trigger an internal allocation even if the functions are not expected to do so. Add a new internal helper for non-allocations, that will assert that condition, and make any other function that requires this behavior call this one instead. Warned-by: coverity
libbsd - Utility functions from BSD systems This library provides useful functions commonly found on BSD systems, and lacking on others like GNU systems, thus making it easier to port projects with strong BSD origins, without needing to embed the same code over and over again on each project. Releases -------- <https://libbsd.freedesktop.org/releases/> Mailing List ------------ The subscription interface and web archives can be found at: <https://lists.freedesktop.org/mailman/listinfo/libbsd> The mail address is: libbsd@lists.freedesktop.org Source Repository ----------------- The master repository can be browsed at: <https://cgit.freedesktop.org/libbsd> and cloned from: <https://anongit.freedesktop.org/git/libbsd>
Languages
C
88.3%
C++
5.2%
M4
4.1%
Makefile
1.9%
Shell
0.5%