~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/archive/ha_archive.cc

  • Committer: Monty Taylor
  • Date: 2009-01-30 04:39:04 UTC
  • mto: (779.7.3 devel)
  • mto: This revision was merged to the branch mainline in revision 823.
  • Revision ID: mordred@inaugust.com-20090130043904-gphdonl7m6zdz06v
Cleaned up warnings up through innodb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
577
577
  {
578
578
    if (fstat(frm_file, &file_stat))
579
579
    {
580
 
      frm_ptr= (unsigned char *)malloc(sizeof(unsigned char) *
581
 
                                       file_stat.st_size);
 
580
      if (file_stat.st_size > SIZE_MAX)
 
581
      {
 
582
        error= ENOMEM;
 
583
        goto error2;
 
584
      }
 
585
      frm_ptr= (unsigned char *)malloc((size_t)file_stat.st_size);
582
586
      if (frm_ptr)
583
587
      {
584
 
        my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0));
585
 
        azwrite_frm(&create_stream, (char *)frm_ptr, file_stat.st_size);
586
 
        free((unsigned char*)frm_ptr);
 
588
        my_read(frm_file, frm_ptr, (size_t)file_stat.st_size, MYF(0));
 
589
        azwrite_frm(&create_stream, (char *)frm_ptr, (size_t)file_stat.st_size);
 
590
        free(frm_ptr);
587
591
      }
588
592
    }
589
593
    my_close(frm_file, MYF(0));