#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0-sea
2696 Chuck Bell 2008-09-24
BUG#39598 Valgrind warnings in backup_functions and backup_procedures
Valgrind warning caused by incorrect setting of str_length for m_path.
modified:
sql/backup/stream.cc
per-file messages:
sql/backup/stream.cc
Corrects calculation of length by removing extra allocated length.
=== modified file 'sql/backup/stream.cc'
--- a/sql/backup/stream.cc 2008-08-08 17:21:31 +0000
+++ b/sql/backup/stream.cc 2008-09-24 14:00:57 +0000
@@ -308,7 +308,7 @@ int Stream::prepare_path(::String *backu
char new_path[FN_LEN];
if (make_relative_path(new_path, orig_loc.str, backupdir))
m_path.length(0);
- path_len= strlen(new_path) + 1;
+ path_len= strlen(new_path);
m_path.alloc(path_len);
m_path.length(0);
m_path.append(new_path);
@@ -323,7 +323,7 @@ int Stream::prepare_path(::String *backu
calculated path becomes
'/dev/dec.bak'
*/
- path_len=backupdir->length() + orig_loc.length + 1;
+ path_len=backupdir->length() + orig_loc.length;
m_path.alloc(path_len);
fn_format(m_path.c_ptr(), orig_loc.str, backupdir->c_ptr(), "",
MY_UNPACK_FILENAME);
@@ -338,7 +338,7 @@ int Stream::prepare_path(::String *backu
calculated path becomes
'/dev/weekly/week2.bak'
*/
- path_len= orig_loc.length + 1;
+ path_len= orig_loc.length;
m_path.alloc(path_len);
m_path.length(0);
m_path.append(orig_loc.str);