diff options
author | EuAndreh <eu@euandre.org> | 2024-06-30 10:33:48 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-06-30 10:33:48 -0300 |
commit | 57a51f4b77977a0392e499fa61f9284df9c9c02a (patch) | |
tree | 3bee1e5204d80b5e6725aa9a1b35ec0edf7d03f4 /src | |
parent | src/vector.h: Remove const markers that do not influence the interface (diff) | |
download | pindaiba-57a51f4b77977a0392e499fa61f9284df9c9c02a.tar.gz pindaiba-57a51f4b77977a0392e499fa61f9284df9c9c02a.tar.xz |
src/util.c: Tolerate be given a NULL pointer
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -21,6 +21,10 @@ EXIT_USAGE = 2; void freeit(const void **const ptr) { + if (ptr == NULL) { + return; + } + free((void *)*ptr); *ptr = NULL; } |