Index: runtime/bin/directory_linux.cc |
=================================================================== |
--- runtime/bin/directory_linux.cc (revision 24116) |
+++ runtime/bin/directory_linux.cc (working copy) |
@@ -23,7 +23,7 @@ |
PathBuffer::PathBuffer() : length_(0) { |
- data_ = new char[PATH_MAX + 1]; |
+ data_ = calloc(PATH_MAX + 1, sizeof(char)); // NOLINT |
} |
bool PathBuffer::AddW(const wchar_t* name) { |
@@ -195,6 +195,17 @@ |
} |
+void DirectoryListingEntry::ResetLink() { |
+ if (link_ != NULL && (parent_ == NULL || parent_->link_ != link_)) { |
+ delete link_; |
+ link_ = NULL; |
+ } |
+ if (parent_ != NULL) { |
+ link_ = parent_->link_; |
+ } |
+} |
+ |
+ |
static bool DeleteRecursively(PathBuffer* path); |