Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50844525 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix [2483384] logcat crash when malloc debug is enabled

fix a couple of uninitialized variables

Change-Id: I1f7552ecb20d85dbf0fec5cae9778a70ff9281a2
parent 8d2f91db
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -66,6 +66,7 @@ struct log_device_t {
        device = d;
        device = d;
        binary = b;
        binary = b;
        label = l;
        label = l;
        queue = NULL;
        next = NULL;
        next = NULL;
        printed = false;
        printed = false;
    }
    }
@@ -158,7 +159,7 @@ void printBinary(struct logger_entry *buf)


static void processBuffer(log_device_t* dev, struct logger_entry *buf)
static void processBuffer(log_device_t* dev, struct logger_entry *buf)
{
{
    int bytesWritten;
    int bytesWritten = 0;
    int err;
    int err;
    AndroidLogEntry entry;
    AndroidLogEntry entry;
    char binaryMsgBuf[1024];
    char binaryMsgBuf[1024];
@@ -276,7 +277,7 @@ static void readLogLines(log_device_t* devices)
        if (result >= 0) {
        if (result >= 0) {
            for (dev=devices; dev; dev = dev->next) {
            for (dev=devices; dev; dev = dev->next) {
                if (FD_ISSET(dev->fd, &readset)) {
                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 */
                    /* NOTE: driver guarantees we read exactly one full entry */
                    ret = read(dev->fd, entry->buf, LOGGER_ENTRY_MAX_LEN);
                    ret = read(dev->fd, entry->buf, LOGGER_ENTRY_MAX_LEN);
                    if (ret < 0) {
                    if (ret < 0) {