diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-30 21:51:06 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-30 21:51:06 +0100 |
commit | 80ed1262bd654fe2de30389f97a985b5f2c1d783 (patch) | |
tree | 020b1b63d637e07882c9a10d81fe2ac04ce82bcc /backend/String.cpp | |
parent | c45a436fc594101f676cfabe90225d825d935fec (diff) |
add more containers and fix use after free
Diffstat (limited to 'backend/String.cpp')
-rw-r--r-- | backend/String.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/backend/String.cpp b/backend/String.cpp index e387589..a8b648a 100644 --- a/backend/String.cpp +++ b/backend/String.cpp @@ -34,6 +34,7 @@ String String::va_fmt(va_list args, const char * fmt) { out._data_len = vsnprintf(NULL, 0, fmt, args_copy); va_end(args_copy); + safe_free(out._data); out._data = static_cast<char *>(malloc(out._data_len + 1)); vsnprintf(out._data, out._data_len + 1, fmt, args); return out; |