ncplane_new_internal(): check ncplane malloc #1348

pull/1349/head
nick black 3 years ago
parent 5925d4e121
commit 07dd9dddde
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -290,6 +290,9 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n,
return NULL;
}
ncplane* p = malloc(sizeof(*p));
if(p == NULL){
return NULL;
}
size_t fbsize = sizeof(*p->fb) * (nopts->rows * nopts->cols);
if((p->fb = malloc(fbsize)) == NULL){
logerror(nc, "Error allocating cellmatrix (r=%d, c=%d)\n",

Loading…
Cancel
Save