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

Commit 2b8852de authored by Michael Lentine's avatar Michael Lentine
Browse files

Fix native_handle_create to check if malloc fails

Bug: 18076253
Change-Id: I8dbe3af88f52f18f74a3ab857fea53ae7585e2f7
parent 4cafe2ff
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -30,9 +30,11 @@ native_handle_t* native_handle_create(int numFds, int numInts)
    native_handle_t* h = malloc(
            sizeof(native_handle_t) + sizeof(int)*(numFds+numInts));

    if (h) {
        h->version = sizeof(native_handle_t);
        h->numFds = numFds;
        h->numInts = numInts;
    }
    return h;
}