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

Commit 13d779d6 authored by Mikhail Lappo's avatar Mikhail Lappo Committed by android-build-merger
Browse files

Merge "Possible null pointer miss on realloc"

am: 9bbbaf14

Change-Id: I8dba5053954efd4374aecce98771b3348ffd073b
parents 0cb8c69b 9bbbaf14
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -301,6 +301,7 @@ static void read_canned_config(char* filename)
            allocated *= 2;
            canned_config = (struct fs_config_entry*)realloc(
                canned_config, allocated * sizeof(struct fs_config_entry));
            if (canned_config == NULL) die("failed to reallocate memory");
        }

        struct fs_config_entry* cc = canned_config + used;
@@ -320,6 +321,7 @@ static void read_canned_config(char* filename)
        ++allocated;
        canned_config = (struct fs_config_entry*)realloc(
            canned_config, allocated * sizeof(struct fs_config_entry));
        if (canned_config == NULL) die("failed to reallocate memory");
    }
    canned_config[used].name = NULL;