]> gitweb.hamatoma.de Git - crepublib/commitdiff
valgrind clean
authorhama <hama@siduction.net>
Tue, 6 Jan 2015 00:47:25 +0000 (01:47 +0100)
committerhama <hama@siduction.net>
Tue, 6 Jan 2015 00:47:25 +0000 (01:47 +0100)
base/ReByteBuffer.cpp
os/ReDirTools.cpp

index 6e6a3937d5338f662441f83a1634e238b67f0616..36ebc73beac0f3fb0a6b74e9e47abf92061d2763 100644 (file)
@@ -258,7 +258,7 @@ void ReByteBuffer::ensureSize(size_t size){
                        memcpy(buffer, m_buffer, m_length);
                buffer[m_length] = '\0';
                if (m_buffer != m_primaryBuffer)
-                       delete m_buffer;
+                       delete[] m_buffer;
                m_buffer = buffer;
                m_capacity = size;
        }
index 7137fb3086da26f6c0c63f399896765ee08e2066..0a3b11774fd7be2b7f4c37792cbebe1c92a6349a 100644 (file)
@@ -104,7 +104,7 @@ ReDirOptions::ReDirOptions(const char* usage[], const char* examples[]) :
  * Destructor.
  */
 ReDirOptions::~ReDirOptions(){
-    delete m_compoundUsage;
+    delete[] m_compoundUsage;
 }
 /**
  * Initializes the compound usage message array.
@@ -112,7 +112,7 @@ ReDirOptions::~ReDirOptions(){
  * @param size      the size of the array: size = (field1 + field2 + ...) * sizeof(const char*)
  */
 void ReDirOptions::initCompoundUsage(size_t size){
-    delete m_compoundUsage;
+    delete[] m_compoundUsage;
     int count = size / sizeof m_compoundUsage[0];
     m_compoundUsage = new const char*[count];
     memset(m_compoundUsage, 0, size);
@@ -914,7 +914,9 @@ void ReDirBatch::createBatch(int argc, const char* argv[]){
         if (arguments.length() + script.length() == 0)
             help(i18n("one of the option must be set: -a (--arguments) or -c (--script)"));
         bool verbose = ! m_programArgs.getBool("quiet");
-        bool isExe = ! m_programArgs.getBool("isexe");
+#if defined __WIN32__
+        bool isExe = m_programArgs.getBool("isexe");
+#endif
         setFilterFromProgramArgs(filter);
         if (m_programArgs.getArgCount() == 0)
             help(i18n("no arguments given (missing path)"));
@@ -944,8 +946,10 @@ void ReDirBatch::createBatch(int argc, const char* argv[]){
                 }
                 if (script.length() > 0){
                     line.setLength(0);
+#if defined __WIN32__
                     if (! isExe)
                         line.append("call ");
+#endif
                     line.append(script).append(" ").append(delim, -1);
                     line.append(entry->m_path).append(entry->node(), -1);
                     line.append(delim, -1);