Text   |  XML   |  ReML   |   Visible Warnings:

Leak  at lemon.c:1494

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

main

(/home/sate/Testcases/c/cve/wireshark-1.2.0/tools/lemon/lemon.c)expand/collapse
Show more  
 1444  int main(int argc _U_, char **argv)
 1445  {
 1446    static int version = 0;
 1447    static int rpflag = 0;
 1448    static int basisflag = 0;
 1449    static int compress = 0;
 1450    static int quiet = 0;
 1451    static int statistics = 0;
 1452    static int mhflag = 0;
 1453    static char *outdirname = NULL;
 1454    static char *templatename = NULL;
 1455    static struct s_options options[] = {
 1456      {OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."},
 1457      {OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."},
 1458      {OPT_STR,  "d", (char*)&outdirname, "Output directory name."},
 1459      {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."},
 1460      {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."},
 1461      {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file"},
 1462      {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
 1463      {OPT_FLAG, "s", (char*)&statistics,
 1464                                     "Print parser stats to standard output."},
 1465      {OPT_STR,  "t", (char*)&templatename, "Template file to use."},
 1466      {OPT_FLAG, "x", (char*)&version, "Print the version number."},
 1467      {OPT_FLAG,0,0,0}
 1468    };
 1469    int i;
 1470    struct lemon lem;
 1471   
 1472    optinit(argv,options,stderr);
 1473    if( version ){
 1474       printf("Lemon version 1.0\n"
 1475         "Copyright 1991-1997 by D. Richard Hipp\n"
 1476         "Freely distributable under the GNU Public License.\n"
 1477       );
 1478       exit(0);
 1479    }
 1480[+]   if( optnargs()!=1 ){
 1481      fprintf(stderr,"Exactly one filename argument is required.\n");
 1482      exit(1);
 1483    }
 1484    memset(&lem, 0, sizeof(lem));
 1485    lem.errorcnt = 0;
 1486   
 1487    /* Initialize the machine */
 1488    Strsafe_init();
 1489    Symbol_init();
 1490    State_init();
 1491    lem.argv0 = argv[0];
 1492    lem.filename = get_optarg(0);
 1493    lem.basisflag = basisflag;
 1494[+]   Symbol_new("$");
expand/collapse

Symbol_new

(/home/sate/Testcases/c/cve/wireshark-1.2.0/tools/lemon/lemon.c)expand/collapse
Show more  
 4408  struct symbol *Symbol_new(const char *x)
 4409  {
 4410    struct symbol *sp;
 4411   
 4412    sp = Symbol_find(x);
 4413    if( sp==0 ){
 4414      sp = (struct symbol *)calloc(1, sizeof(struct symbol) );
 4415      MemoryCheck(sp);
 4416      sp->name = Strsafe(x);
 4417      sp->type = safe_isupper(*x) ? TERMINAL : NONTERMINAL;
 4418      sp->rule = 0;
 4419      sp->fallback = 0;
 4420      sp->prec = -1;
 4421      sp->assoc = UNK;
 4422      sp->firstset = 0;
 4423      sp->lambda = LEMON_FALSE;
 4424      sp->destructor = 0;
 4425          sp->destLineno = 0;
 4426      sp->datatype = 0;
 4427          sp->useCnt = 0;
 4428[+]     Symbol_insert(sp,sp->name);
 4429    }
 4430    sp->useCnt++;
 4431    return sp;
Show more  
 1495    lem.errsym = Symbol_new("error");
Show more  




Change Warning 927.30678 : Leak

Priority:
State:
Finding:
Owner:
Note: