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

Commit 35d84096 authored by Mattias Nissler's avatar Mattias Nissler Committed by Gerrit Code Review
Browse files

Merge "fs_mgr: Remove incorrect free() on error paths in load_key()"

parents 04045fd4 31404e58
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -91,14 +91,12 @@ static RSA *load_key(const char *path)
    FILE* f = fopen(path, "r");
    FILE* f = fopen(path, "r");
    if (!f) {
    if (!f) {
        ERROR("Can't open '%s'\n", path);
        ERROR("Can't open '%s'\n", path);
        free(key_data);
        return NULL;
        return NULL;
    }
    }


    if (!fread(key_data, sizeof(key_data), 1, f)) {
    if (!fread(key_data, sizeof(key_data), 1, f)) {
        ERROR("Could not read key!\n");
        ERROR("Could not read key!\n");
        fclose(f);
        fclose(f);
        free(key_data);
        return NULL;
        return NULL;
    }
    }


@@ -107,7 +105,6 @@ static RSA *load_key(const char *path)
    RSA* key = NULL;
    RSA* key = NULL;
    if (!android_pubkey_decode(key_data, sizeof(key_data), &key)) {
    if (!android_pubkey_decode(key_data, sizeof(key_data), &key)) {
        ERROR("Could not parse key!\n");
        ERROR("Could not parse key!\n");
        free(key_data);
        return NULL;
        return NULL;
    }
    }