diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-29 20:01:27 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-29 20:01:27 +0100 |
commit | 9283e1eb66d6ff96b02f317e28cb6ff060953cdf (patch) | |
tree | c03d853ef620216f1c2299936004f56c6c3cee04 /backend/util.cpp | |
parent | 7285f9f2c2622acff734e31314f92df9b25cae16 (diff) |
WIP load XML
Diffstat (limited to 'backend/util.cpp')
-rw-r--r-- | backend/util.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/util.cpp b/backend/util.cpp new file mode 100644 index 0000000..4a55f63 --- /dev/null +++ b/backend/util.cpp @@ -0,0 +1,14 @@ +#include <stdlib.h> + +#include "util.h" + +void safe_free(void * & ptr) { + if (ptr == nullptr) return; + free(ptr); + ptr = nullptr; +} +void safe_free(const char * & ptr) { + auto x = static_cast<void *>(const_cast<char *>(ptr)); + safe_free(x); +} + |