summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian2010-03-17 18:10:26 -0500
committerMathias Agopian2010-03-17 18:10:26 -0500
commit50844525a31fa41d7d432efb3c0355b38adb2f5f (patch)
treeab715848aaadc3ff1e790ff28732dbc8f378cc74
parent8d2f91db21271a253bfe1bbe7716ff59e88572bd (diff)
downloadplatform-system-core-50844525a31fa41d7d432efb3c0355b38adb2f5f.tar.gz
platform-system-core-50844525a31fa41d7d432efb3c0355b38adb2f5f.tar.xz
platform-system-core-50844525a31fa41d7d432efb3c0355b38adb2f5f.zip
fix [2483384] logcat crash when malloc debug is enabled
fix a couple of uninitialized variables Change-Id: I1f7552ecb20d85dbf0fec5cae9778a70ff9281a2
-rw-r--r--logcat/logcat.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index 4b23c8d0d..5acdf7772 100644
--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -66,6 +66,7 @@ struct log_device_t {
66 device = d; 66 device = d;
67 binary = b; 67 binary = b;
68 label = l; 68 label = l;
69 queue = NULL;
69 next = NULL; 70 next = NULL;
70 printed = false; 71 printed = false;
71 } 72 }
@@ -158,7 +159,7 @@ void printBinary(struct logger_entry *buf)
158 159
159static void processBuffer(log_device_t* dev, struct logger_entry *buf) 160static void processBuffer(log_device_t* dev, struct logger_entry *buf)
160{ 161{
161 int bytesWritten; 162 int bytesWritten = 0;
162 int err; 163 int err;
163 AndroidLogEntry entry; 164 AndroidLogEntry entry;
164 char binaryMsgBuf[1024]; 165 char binaryMsgBuf[1024];
@@ -276,7 +277,7 @@ static void readLogLines(log_device_t* devices)
276 if (result >= 0) { 277 if (result >= 0) {
277 for (dev=devices; dev; dev = dev->next) { 278 for (dev=devices; dev; dev = dev->next) {
278 if (FD_ISSET(dev->fd, &readset)) { 279 if (FD_ISSET(dev->fd, &readset)) {
279 queued_entry_t* entry = new queued_entry_t; 280 queued_entry_t* entry = new queued_entry_t();
280 /* NOTE: driver guarantees we read exactly one full entry */ 281 /* NOTE: driver guarantees we read exactly one full entry */
281 ret = read(dev->fd, entry->buf, LOGGER_ENTRY_MAX_LEN); 282 ret = read(dev->fd, entry->buf, LOGGER_ENTRY_MAX_LEN);
282 if (ret < 0) { 283 if (ret < 0) {