From 1eaa175431769969f6adcd3d0d3fa1e290844a80 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 24 Sep 2022 19:24:20 +0100 Subject: [PATCH] Make malloc usage consistent in CarlaString class Signed-off-by: falkTX --- source/utils/CarlaString.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/utils/CarlaString.hpp b/source/utils/CarlaString.hpp index 8197c0c6e..a0bff935e 100644 --- a/source/utils/CarlaString.hpp +++ b/source/utils/CarlaString.hpp @@ -813,7 +813,7 @@ public: const std::size_t strBufLen = std::strlen(strBuf); const std::size_t newBufSize = fBufferLen + strBufLen; - char* const newBuf = (char*)malloc(newBufSize + 1); + char* const newBuf = (char*)std::malloc(newBufSize + 1); CARLA_SAFE_ASSERT_RETURN(newBuf != nullptr, CarlaString()); std::memcpy(newBuf, fBuffer, fBufferLen); @@ -918,7 +918,7 @@ CarlaString operator+(const CarlaString& strBefore, const char* const strBufAfte const std::size_t strBeforeLen = strBefore.length(); const std::size_t strBufAfterLen = std::strlen(strBufAfter); const std::size_t newBufSize = strBeforeLen + strBufAfterLen; - char* const newBuf = (char*)malloc(newBufSize + 1); + char* const newBuf = (char*)std::malloc(newBufSize + 1); CARLA_SAFE_ASSERT_RETURN(newBuf != nullptr, CarlaString()); std::memcpy(newBuf, strBefore.buffer(), strBeforeLen); @@ -938,7 +938,7 @@ CarlaString operator+(const char* const strBufBefore, const CarlaString& strAfte const std::size_t strBufBeforeLen = std::strlen(strBufBefore); const std::size_t strAfterLen = strAfter.length(); const std::size_t newBufSize = strBufBeforeLen + strAfterLen; - char* const newBuf = (char*)malloc(newBufSize + 1); + char* const newBuf = (char*)std::malloc(newBufSize + 1); CARLA_SAFE_ASSERT_RETURN(newBuf != nullptr, CarlaString()); std::memcpy(newBuf, strBufBefore, strBufBeforeLen);