Substitute malloc/free with new/delete

This commit is contained in:
Luis Diaz Mas
2018-08-27 11:50:17 +02:00
committed by Luis Díaz Más
parent 08cbb0c206
commit eb306fdbae
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -102,7 +102,7 @@ namespace Exiv2 {
char* urldecode(const char* str) {
const char* pstr = str;
char* buf = (char*)malloc(strlen(str) + 1);
char* buf = new char [(strlen(str) + 1)];
char* pbuf = buf;
while (*pstr) {
if (*pstr == '%') {
@@ -124,7 +124,7 @@ namespace Exiv2 {
void urldecode(std::string& str) {
char* decodeStr = Exiv2::urldecode(str.c_str());
str = std::string(decodeStr);
free(decodeStr);
delete [] decodeStr;
}
int base64encode(const void* data_buf, size_t dataLength, char* result, size_t resultSize) {