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

Commit 7d626df0 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Fix minui cleanup path on error.

  bootable/recovery/minui/resources.cpp:321:21: warning: Branch condition evaluates to a garbage value
                if (surface[i]) free(surface[i]);
                    ^~~~~~~~~~
  bootable/recovery/minui/resources.cpp:424:13: warning: Value stored to 'len' during its initialization is never read
        int len = row[4];
            ^~~   ~~~~~~

Bug: http://b/27264652
Change-Id: Icc1a914c59d6a89dab1b752b2cd2b40549566481
parent b30663b4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ int res_create_multi_display_surface(const char* name, int* frames, int* fps,
        goto exit;
    }

    surface = reinterpret_cast<GRSurface**>(malloc(*frames * sizeof(GRSurface*)));
    surface = reinterpret_cast<GRSurface**>(calloc(*frames, sizeof(GRSurface*)));
    if (surface == NULL) {
        result = -8;
        goto exit;
@@ -318,7 +318,7 @@ exit:
    if (result < 0) {
        if (surface) {
            for (int i = 0; i < *frames; ++i) {
                if (surface[i]) free(surface[i]);
                free(surface[i]);
            }
            free(surface);
        }
@@ -421,7 +421,7 @@ int res_create_localized_alpha_surface(const char* name,
        png_read_row(png_ptr, row.data(), NULL);
        int w = (row[1] << 8) | row[0];
        int h = (row[3] << 8) | row[2];
        int len = row[4];
        __unused int len = row[4];
        char* loc = reinterpret_cast<char*>(&row[5]);

        if (y+1+h >= height || matches_locale(loc, locale)) {