diff options
author | 1997-11-29 05:01:20 +0000 | |
---|---|---|
committer | 1997-11-29 05:01:20 +0000 | |
commit | c98131720eafae655d3e29c83b0a311973ccc6f9 (patch) | |
tree | cda9a58041c7cb20c7857a6d09a8b58d55ae357c /lib/libcurses/lib_resize.c | |
parent | NAT requires IPF (diff) | |
download | wireguard-openbsd-c98131720eafae655d3e29c83b0a311973ccc6f9.tar.xz wireguard-openbsd-c98131720eafae655d3e29c83b0a311973ccc6f9.zip |
Check malloc() return vals.
Diffstat (limited to 'lib/libcurses/lib_resize.c')
-rw-r--r-- | lib/libcurses/lib_resize.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libcurses/lib_resize.c b/lib/libcurses/lib_resize.c index be2f199d78b..0855d3f9fb5 100644 --- a/lib/libcurses/lib_resize.c +++ b/lib/libcurses/lib_resize.c @@ -57,8 +57,10 @@ int wresize(WINDOW *win, int new_lines, int new_cols) tp->text = &(win->_parent->_line[win->_pary+i].text[win->_parx]); else /* allocate new lines if needed */ { - if (!(tp->text = (chtype *)malloc(sizeof(chtype) * new_cols))) + if (!(tp->text = (chtype *)malloc(sizeof(chtype) * new_cols))) { + errno = ENOMEM; return(ERR); + } for (j = 0; j < new_cols; j++) tp->text[j] = blank; } |