summaryrefslogtreecommitdiffstats
path: root/lib/libcurses/lib_resize.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1997-11-29 05:01:20 +0000
committermillert <millert@openbsd.org>1997-11-29 05:01:20 +0000
commitc98131720eafae655d3e29c83b0a311973ccc6f9 (patch)
treecda9a58041c7cb20c7857a6d09a8b58d55ae357c /lib/libcurses/lib_resize.c
parentNAT requires IPF (diff)
downloadwireguard-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.c4
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;
}