~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/archive/ha_archive.cc

merge with the latest code from the trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
  if (frm_stream.frm_length == 0)
238
238
    goto err;
239
239
 
240
 
  frm_ptr= (char *)my_malloc(sizeof(char) * frm_stream.frm_length, MYF(0));
 
240
  frm_ptr= (char *)malloc(sizeof(char) * frm_stream.frm_length);
 
241
  if (frm_ptr == NULL)
 
242
  {
 
243
    goto err;
 
244
  }
 
245
 
241
246
  azread_frm(&frm_stream, frm_ptr);
242
247
  azclose(&frm_stream);
243
248
 
614
619
    {
615
620
      if (fstat(frm_file, &file_stat))
616
621
      {
617
 
        frm_ptr= (unsigned char *)my_malloc(sizeof(unsigned char) * file_stat.st_size, MYF(0));
 
622
        frm_ptr= (unsigned char *)malloc(sizeof(unsigned char) *
 
623
                                         file_stat.st_size);
618
624
        if (frm_ptr)
619
625
        {
620
626
          my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0));
777
783
        First we create a buffer that we can use for reading rows, and can pass
778
784
        to get_row().
779
785
      */
780
 
      if (!(read_buf= (unsigned char*) my_malloc(table->s->reclength, MYF(MY_WME))))
 
786
      if (!(read_buf= (unsigned char*) malloc(table->s->reclength)))
781
787
      {
782
788
        rc= HA_ERR_OUT_OF_MEM;
783
789
        goto error;
957
963
  if (length > record_buffer->length)
958
964
  {
959
965
    unsigned char *newptr;
960
 
    if (!(newptr=(unsigned char*) my_realloc((unsigned char*) record_buffer->buffer,
961
 
                                    length,
962
 
                                    MYF(MY_ALLOW_ZERO_PTR))))
 
966
    if (!(newptr= (unsigned char *)realloc(record_buffer->buffer, length)))
963
967
      return(1);
964
968
    record_buffer->buffer= newptr;
965
969
    record_buffer->length= length;
1407
1411
archive_record_buffer *ha_archive::create_record_buffer(unsigned int length)
1408
1412
{
1409
1413
  archive_record_buffer *r;
1410
 
  if (!(r=
1411
 
        (archive_record_buffer*) my_malloc(sizeof(archive_record_buffer),
1412
 
                                           MYF(MY_WME))))
 
1414
  if (!(r= (archive_record_buffer*) malloc(sizeof(archive_record_buffer))))
1413
1415
  {
1414
1416
    return(NULL); /* purecov: inspected */
1415
1417
  }
1416
1418
  r->length= (int)length;
1417
1419
 
1418
 
  if (!(r->buffer= (unsigned char*) my_malloc(r->length,
1419
 
                                    MYF(MY_WME))))
 
1420
  if (!(r->buffer= (unsigned char*) malloc(r->length)))
1420
1421
  {
1421
1422
    free((char*) r);
1422
1423
    return(NULL); /* purecov: inspected */