~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Monty Taylor
  • Date: 2008-12-09 00:32:07 UTC
  • mto: This revision was merged to the branch mainline in revision 670.
  • Revision ID: monty@inaugust.com-20081209003207-bvrq0tij9z1sfa16
More malloc return cleanups.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2427
2427
  if (!lex->yacc_yyvs)
2428
2428
    old_info= *yystacksize;
2429
2429
  *yystacksize= set_zone((*yystacksize)*2,MY_YACC_INIT,MY_YACC_MAX);
2430
 
  if (!(lex->yacc_yyvs= (lex->yacc_yyvs) 
2431
 
        ? (unsigned char*)realloc(lex->yacc_yyvs,
2432
 
                                  *yystacksize* sizeof(**yyvs))
2433
 
        : (unsigned char*)malloc(*yystacksize*sizeof(**yyvs))))
2434
 
      return 1;
2435
 
  if (!(lex->yacc_yyss= (lex->yacc_yyss) 
2436
 
        ? (unsigned char*)realloc(lex->yacc_yyss,
2437
 
                                  *yystacksize* sizeof(**yyss))
2438
 
        : (unsigned char*)malloc(*yystacksize*sizeof(**yyss))))
2439
 
      return 1;
 
2430
  unsigned char *tmpptr= NULL;
 
2431
  if (!(tmpptr= (unsigned char *)realloc(lex->yacc_yyvs,
 
2432
                                         *yystacksize* sizeof(**yyvs))))
 
2433
      return 1;
 
2434
  lex->yacc_yyvs= tmpptr;
 
2435
  tmpptr= NULL;
 
2436
  if (!(tmpptr= (unsigned char*)realloc(lex->yacc_yyss,
 
2437
                                        *yystacksize* sizeof(**yyss))))
 
2438
      return 1;
 
2439
  lex->yacc_yyss= tmpptr;
2440
2440
  if (old_info)
2441
2441
  {                                             // Copy old info from stack
2442
2442
    memcpy(lex->yacc_yyss, *yyss, old_info*sizeof(**yyss));