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

Commit 11ca129c authored by George Burgess IV's avatar George Burgess IV Committed by android-build-merger
Browse files

Merge "Fix static analyzer warnings." am: ff5c3ad0 am: 1db1a86b

am: e7625305

Change-Id: I37be36a86dbab762c64696843916e88f17908251
parents ee18f669 e7625305
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -739,7 +739,7 @@ const char16_t* ResStringPool::stringAt(size_t idx, size_t* u16len) const
                        ALOGW("CREATING STRING CACHE OF %zu bytes",
                                static_cast<size_t>(mHeader->stringCount*sizeof(char16_t**)));
#endif
                        mCache = (char16_t**)calloc(mHeader->stringCount, sizeof(char16_t**));
                        mCache = (char16_t**)calloc(mHeader->stringCount, sizeof(char16_t*));
                        if (mCache == NULL) {
                            ALOGW("No memory trying to allocate decode cache table of %d bytes\n",
                                    (int)(mHeader->stringCount*sizeof(char16_t**)));
@@ -4390,10 +4390,12 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag,
            if (set->numAttrs >= set->availAttrs) {
                // Need to alloc more memory...
                const size_t newAvail = set->availAttrs+N;
                void *oldSet = set;
                set = (bag_set*)realloc(set,
                                        sizeof(bag_set)
                                        + sizeof(bag_entry)*newAvail);
                if (set == NULL) {
                    free(oldSet);
                    return NO_MEMORY;
                }
                set->availAttrs = newAvail;
@@ -4440,7 +4442,7 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag,
        pos++;
        const size_t size = dtohs(map->value.size);
        curOff += size + sizeof(*map)-sizeof(map->value);
    };
    }

    if (curEntry > set->numAttrs) {
        set->numAttrs = curEntry;