Merge "Fix native_handle_create to check if malloc fails" into lmp-mr1-dev

This commit is contained in:
Michael Lentine 2014-11-03 22:13:48 +00:00 committed by Android (Google) Code Review
commit b542285436

View file

@ -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));
h->version = sizeof(native_handle_t);
h->numFds = numFds;
h->numInts = numInts;
if (h) {
h->version = sizeof(native_handle_t);
h->numFds = numFds;
h->numInts = numInts;
}
return h;
}