return NULL at all appropriate places
authorKen Arnold <arnold@ucbvax.Berkeley.EDU>
Mon, 26 Oct 1981 16:03:30 +0000 (08:03 -0800)
committerKen Arnold <arnold@ucbvax.Berkeley.EDU>
Mon, 26 Oct 1981 16:03:30 +0000 (08:03 -0800)
SCCS-vsn: lib/libcurses/newwin.c 1.2

usr/src/lib/libcurses/newwin.c

index 57fd77e..9485bff 100644 (file)
@@ -114,16 +114,18 @@ int       num_lines, num_cols, begy, begx; {
 # endif
        if ((win->_y = (char **) calloc(nl, sizeof (char *))) == NULL) {
                cfree(win);
 # endif
        if ((win->_y = (char **) calloc(nl, sizeof (char *))) == NULL) {
                cfree(win);
-               return (WINDOW *) NULL;
+               return NULL;
        }
        if ((win->_firstch = calloc(nl, sizeof (short))) == NULL) {
                cfree(win);
                cfree(win->_y);
        }
        if ((win->_firstch = calloc(nl, sizeof (short))) == NULL) {
                cfree(win);
                cfree(win->_y);
+               return NULL;
        }
        if ((win->_lastch = calloc(nl, sizeof (short))) == NULL) {
                cfree(win);
                cfree(win->_y);
                cfree(win->_firstch);
        }
        if ((win->_lastch = calloc(nl, sizeof (short))) == NULL) {
                cfree(win);
                cfree(win->_y);
                cfree(win->_firstch);
+               return NULL;
        }
 # ifdef DEBUG
        fprintf(outf, "MAKENEW: nc = %d\n", nc);
        }
 # ifdef DEBUG
        fprintf(outf, "MAKENEW: nc = %d\n", nc);