diff options
Diffstat (limited to 'sql/discover.cc')
-rw-r--r-- | sql/discover.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/discover.cc b/sql/discover.cc index 72b88c8780b..82dc8d97d65 100644 --- a/sql/discover.cc +++ b/sql/discover.cc @@ -74,9 +74,13 @@ int readfrm(const char *name, uchar **frmdata, size_t *len) // Read whole frm file error= 3; - read_data= 0; // Nothing to free - if (read_string(file, &read_data, read_len)) + if (!(read_data= (uchar*)my_malloc(read_len, MYF(MY_WME)))) goto err; + if (mysql_file_read(file, read_data, read_len, MYF(MY_NABP))) + { + my_free(read_data); + goto err; + } // Setup return data *frmdata= (uchar*) read_data; |