You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2013/11/14 19:06:14 UTC

git commit: Fixed string leaks in os.hpp.

Updated Branches:
  refs/heads/master f75e0f316 -> bb4db98a9


Fixed string leaks in os.hpp.

From: Niklas Nielsen <ni...@qni.dk>
Review: https://reviews.apache.org/r/15368


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/bb4db98a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/bb4db98a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/bb4db98a

Branch: refs/heads/master
Commit: bb4db98a993724e6ec753fe4f110851ca2a3565e
Parents: f75e0f3
Author: Vinod Kone <vi...@twitter.com>
Authored: Thu Nov 14 09:57:48 2013 -0800
Committer: Vinod Kone <vi...@twitter.com>
Committed: Thu Nov 14 09:57:48 2013 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/bb4db98a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
index 4ce9344..f6bbf5e 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -336,12 +336,12 @@ inline Try<std::string> basename(const std::string& path)
   char* temp = new char[path.size() + 1];
   char* result = ::basename(::strcpy(temp, path.c_str()));
   if (result == NULL) {
-    delete temp;
+    delete[] temp;
     return ErrnoError();
   }
 
   std::string s(result);
-  delete temp;
+  delete[] temp;
   return s;
 }
 
@@ -351,12 +351,12 @@ inline Try<std::string> dirname(const std::string& path)
   char* temp = new char[path.size() + 1];
   char* result = ::dirname(::strcpy(temp, path.c_str()));
   if (result == NULL) {
-    delete temp;
+    delete[] temp;
     return ErrnoError();
   }
 
   std::string s(result);
-  delete temp;
+  delete[] temp;
   return s;
 }
 
@@ -456,10 +456,10 @@ inline Try<std::string> mkdtemp(const std::string& path = "/tmp/XXXXXX")
   char* temp = new char[path.size() + 1];
   if (::mkdtemp(::strcpy(temp, path.c_str())) != NULL) {
     std::string result(temp);
-    delete temp;
+    delete[] temp;
     return result;
   } else {
-    delete temp;
+    delete[] temp;
     return ErrnoError();
   }
 }