Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.57
 
1.58
 
MAIN:ragge:20070916194249
 
cpp.c
_>186186                 case 'i': /* include */
 187187                 case 'U': /* undef */
 188188                 case 'D': /* define something */
<>189 -                        it = malloc(sizeof(struct initar));
  189+                        /* XXX should not need malloc() here */
  190+                        if ((it = malloc(sizeof(struct initar))) == NULL)
  191+                                error("couldn't apply -%c %s", ch, optarg);
190192                         it->type = ch;
 191193                         it->str = optarg;
 192194                         it->next = initar;
     
 !
223225 
 224226                 case 'S':
 225227                 case 'I':
<>226 -                        w = calloc(sizeof(struct incs), 1);
  228+                        if ((w = calloc(sizeof(struct incs), 1)) == NULL)
  229+                                error("couldn't apply -%c %s", ch, optarg);
227230                         w->dir = (usch *)optarg;
 228231                         w2 = incdir[ch == 'I' ? INCINC : SYSINC];
 229232                         if (w2 != NULL) {
     
 !
13241327 static struct tree *sympole;
 13251328 static int numsyms;
 13261329 
<>1327 -#define getree() malloc(sizeof(struct tree))
 1328 -
13291330 /*
 13301331  * Allocate a symtab struct and store the string.
 13311332  */
     
 !
13341335 {
 13351336         struct symtab *sp = malloc(sizeof(struct symtab));
 13361337 
<> 1338+        if (sp == NULL)
  1339+                error("getsymtab: couldn't allocate symtab");
13371340         sp->namep = savstr(str);
 13381341         savch('\0');
 13391342         sp->value = NULL;
     
 !
14071410                 ix >>= 1, cix++;
 14081411 
 14091412         /* Create new node */
<>1410 -        new = getree();
  1413+        if ((new = malloc(sizeof *new)) == NULL)
  1414+                error("getree: couldn't allocate tree");
<_14111415         bit = P_BIT(key, cix);
 14121416         new->bitno = cix | (bit ? RIGHT_IS_LEAF : LEFT_IS_LEAF);
 14131417         new->lr[bit] = (struct tree *)getsymtab(key);
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-01 23:07 +0200