diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 10:47:50 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 10:47:50 -0300 |
commit | 711c318c072f6d5fd5c2877ccc736c7673d1711d (patch) | |
tree | ac8b15ac65b08a492c256369b73e372f6568c7a4 /storage/archive | |
parent | 00538253b592522babe3609af29cb3eb87218b64 (diff) | |
parent | fd64a0db45705ca5eb2ad34ffc2ed1d9ef961017 (diff) | |
download | mariadb-git-711c318c072f6d5fd5c2877ccc736c7673d1711d.tar.gz |
Merge of mysql-trunk-bugfixing into mysql-trunk-merge.
Diffstat (limited to 'storage/archive')
-rw-r--r-- | storage/archive/archive_reader.c | 6 | ||||
-rw-r--r-- | storage/archive/ha_archive.cc | 15 |
2 files changed, 10 insertions, 11 deletions
diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c index bad02835d86..ce4be92a521 100644 --- a/storage/archive/archive_reader.c +++ b/storage/archive/archive_reader.c @@ -201,7 +201,7 @@ int main(int argc, char *argv[]) ptr= (char *)my_malloc(sizeof(char) * reader_handle.frm_length, MYF(0)); azread_frm(&reader_handle, ptr); azwrite_frm(&writer_handle, ptr, reader_handle.frm_length); - my_free(ptr, MYF(0)); + my_free(ptr); } if (reader_handle.comment_length) @@ -210,7 +210,7 @@ int main(int argc, char *argv[]) ptr= (char *)my_malloc(sizeof(char) * reader_handle.comment_length, MYF(0)); azread_comment(&reader_handle, ptr); azwrite_comment(&writer_handle, ptr, reader_handle.comment_length); - my_free(ptr, MYF(0)); + my_free(ptr); } while ((read= azread(&reader_handle, (uchar *)size_buffer, @@ -265,7 +265,7 @@ int main(int argc, char *argv[]) azread_frm(&reader_handle, ptr); my_write(frm_file, (uchar*) ptr, reader_handle.frm_length, MYF(0)); my_close(frm_file, MYF(0)); - my_free(ptr, MYF(0)); + my_free(ptr); } end: diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 2bcfc3ff672..63848370ff1 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -387,7 +387,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc) { *rc= my_errno ? my_errno : -1; mysql_mutex_unlock(&archive_mutex); - my_free(share, MYF(0)); + my_free(share); DBUG_RETURN(NULL); } stats.auto_increment_value= archive_tmp.auto_increment + 1; @@ -447,7 +447,7 @@ int ha_archive::free_share() if (azclose(&(share->archive_write))) rc= 1; } - my_free((uchar*) share, MYF(0)); + my_free(share); } mysql_mutex_unlock(&archive_mutex); @@ -706,7 +706,7 @@ int ha_archive::create(const char *name, TABLE *table_arg, { my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0)); azwrite_frm(&create_stream, (char *)frm_ptr, file_stat.st_size); - my_free((uchar*)frm_ptr, MYF(0)); + my_free(frm_ptr); } } my_close(frm_file, MYF(0)); @@ -932,8 +932,7 @@ int ha_archive::write_row(uchar *buf) rc= real_write_row(buf, &(share->archive_write)); error: mysql_mutex_unlock(&share->mutex); - if (read_buf) - my_free((uchar*) read_buf, MYF(0)); + my_free(read_buf); DBUG_RETURN(rc); } @@ -1696,7 +1695,7 @@ archive_record_buffer *ha_archive::create_record_buffer(unsigned int length) if (!(r->buffer= (uchar*) my_malloc(r->length, MYF(MY_WME)))) { - my_free((char*) r, MYF(MY_ALLOW_ZERO_PTR)); + my_free(r); DBUG_RETURN(NULL); /* purecov: inspected */ } @@ -1706,8 +1705,8 @@ archive_record_buffer *ha_archive::create_record_buffer(unsigned int length) void ha_archive::destroy_record_buffer(archive_record_buffer *r) { DBUG_ENTER("ha_archive::destroy_record_buffer"); - my_free((char*) r->buffer, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) r, MYF(MY_ALLOW_ZERO_PTR)); + my_free(r->buffer); + my_free(r); DBUG_VOID_RETURN; } |