diff options
author | Mathias Agopian <mathias@google.com> | 2010-03-17 16:11:36 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-03-17 16:11:36 -0700 |
commit | 92f66cd254af190d0e475eccc0c32d4b0b09a24d (patch) | |
tree | 0256ada81cac353b54b184c2fc02a84b69a0f591 | |
parent | 1f4d95296acf34a93128332441782a80c10845b4 (diff) | |
parent | 50844525a31fa41d7d432efb3c0355b38adb2f5f (diff) | |
download | system_core-92f66cd254af190d0e475eccc0c32d4b0b09a24d.zip system_core-92f66cd254af190d0e475eccc0c32d4b0b09a24d.tar.gz system_core-92f66cd254af190d0e475eccc0c32d4b0b09a24d.tar.bz2 |
Merge "fix [2483384] logcat crash when malloc debug is enabled"
-rw-r--r-- | logcat/logcat.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp index 4b23c8d..5acdf77 100644 --- a/logcat/logcat.cpp +++ b/logcat/logcat.cpp @@ -66,6 +66,7 @@ struct log_device_t { device = d; binary = b; label = l; + queue = NULL; next = NULL; printed = false; } @@ -158,7 +159,7 @@ void printBinary(struct logger_entry *buf) static void processBuffer(log_device_t* dev, struct logger_entry *buf) { - int bytesWritten; + int bytesWritten = 0; int err; AndroidLogEntry entry; char binaryMsgBuf[1024]; @@ -276,7 +277,7 @@ static void readLogLines(log_device_t* devices) if (result >= 0) { for (dev=devices; dev; dev = dev->next) { if (FD_ISSET(dev->fd, &readset)) { - queued_entry_t* entry = new queued_entry_t; + queued_entry_t* entry = new queued_entry_t(); /* NOTE: driver guarantees we read exactly one full entry */ ret = read(dev->fd, entry->buf, LOGGER_ENTRY_MAX_LEN); if (ret < 0) { |