Просмотр исходного кода

Replace wrong delete[] calls by free() function calls.

dreamer.dead 10 лет назад
Родитель
Сommit
65381c6b68
2 измененных файлов с 7 добавлено и 5 удалено
  1. 6 4
      bin/rl/rl.h
  2. 1 1
      bin/rl/rlmp.cpp

+ 6 - 4
bin/rl/rl.h

@@ -711,18 +711,20 @@ class CThreadInfo
     struct TmpFileList
     {
         TmpFileList* _next;
-        char* _fullPath;
+        char* const _fullPath;
 
         TmpFileList(TmpFileList* next, char* fullPath)
-            : _next(next)
+            : _next(next), _fullPath(_strdup(fullPath))
         {
-            _fullPath = _strdup(fullPath);
         }
 
         ~TmpFileList()
         {
-            delete [] _fullPath;
+            free(_fullPath);
         }
+
+        TmpFileList(const TmpFileList&) = delete;
+        void operator=(const TmpFileList&) = delete;
     };
 
     TmpFileList* _head;

+ 1 - 1
bin/rl/rlmp.cpp

@@ -455,7 +455,7 @@ COutputBuffer::~COutputBuffer()
     _start = _end = NULL;
     _bufSize = 0;
     if (_type == OUT_FILENAME) {
-        delete[] _filename;
+        free(_filename);
         _filename = NULL;
     }
 }