~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleslap.cc

  • Committer: Monty Taylor
  • Date: 2008-12-09 03:18:37 UTC
  • mto: This revision was merged to the branch mainline in revision 670.
  • Revision ID: monty@inaugust.com-20081209031837-yqat1op3y57uvwiy
More malloc return type checking

Show diffs side-by-side

added added

removed removed

Lines of Context:
2324
2324
    count++;
2325
2325
    tmp->length= (size_t)(retstr - ptr);
2326
2326
    tmp->string= (char *)malloc(tmp->length + 1);
 
2327
    if (tmp->string == NULL)
 
2328
    {
 
2329
      fprintf(stderr,"Error allocating memory while parsing delimiter\n");
 
2330
      exit(1);
 
2331
    }
2327
2332
    memcpy(tmp->string, ptr, tmp->length);
2328
2333
    tmp->string[tmp->length]= 0;
2329
2334
    ptr+= retstr - ptr + 1;
2335
2340
  {
2336
2341
    tmp->length= (size_t)((script + length) - ptr);
2337
2342
    tmp->string= (char *)malloc(tmp->length + 1);
 
2343
    if (tmp->string == NULL)
 
2344
    {
 
2345
      fprintf(stderr,"Error allocating memory while parsing delimiter\n");
 
2346
      exit(1);
 
2347
    }
2338
2348
    memcpy(tmp->string, ptr, tmp->length);
2339
2349
    tmp->string[tmp->length]= 0;
2340
2350
    count++;