Add std:: at some forgotten malloc and free

This commit is contained in:
Syping 2021-11-18 17:42:25 +01:00
parent 584105eeed
commit b900df55cc

View file

@ -704,7 +704,7 @@ const std::string RagePhoto::save(uint32_t photoFormat, bool *ok)
*ok = false; *ok = false;
return std::string(); return std::string();
} }
char *data = static_cast<char*>(malloc(size)); char *data = static_cast<char*>(std::malloc(size));
if (!data) { if (!data) {
if (ok) if (ok)
*ok = false; *ok = false;
@ -714,7 +714,7 @@ const std::string RagePhoto::save(uint32_t photoFormat, bool *ok)
if (ok) if (ok)
*ok = saved; *ok = saved;
const std::string sdata = std::string(data, size); const std::string sdata = std::string(data, size);
free(data); std::free(data);
return sdata; return sdata;
} }
@ -861,7 +861,7 @@ bool RagePhoto::setPhoto(const char *data, uint32_t size, uint32_t bufferSize)
} }
} }
else { else {
m_data.photoData = static_cast<char*>(malloc(size)); m_data.photoData = static_cast<char*>(std::malloc(size));
if (!m_data.photoData) { if (!m_data.photoData) {
m_data.error = static_cast<uint8_t>(Error::PhotoMallocError); // 15 m_data.error = static_cast<uint8_t>(Error::PhotoMallocError); // 15
return false; return false;