mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Free memory in unit tests. Makes ASAN happier.
This commit is contained in:
parent
36eb0b7a55
commit
f2408e7e6a
3 changed files with 7 additions and 1 deletions
|
@ -234,7 +234,7 @@ int main(int argc __attribute__((unused)), char *argv[])
|
|||
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
|
||||
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55
|
||||
};
|
||||
uchar *long_buffer= malloc(LONG_BUFFER_SIZE + LSN_STORE_SIZE * 2 + 2);
|
||||
uchar *long_buffer;
|
||||
char **default_argv;
|
||||
PAGECACHE pagecache;
|
||||
LSN lsn, lsn_base, first_lsn;
|
||||
|
@ -255,6 +255,7 @@ int main(int argc __attribute__((unused)), char *argv[])
|
|||
}
|
||||
#endif
|
||||
|
||||
long_buffer= malloc(LONG_BUFFER_SIZE + LSN_STORE_SIZE * 2 + 2);
|
||||
load_defaults("my", load_default_groups, &argc, &argv);
|
||||
get_options(&argc, &argv);
|
||||
default_argv= argv;
|
||||
|
@ -758,6 +759,7 @@ err:
|
|||
if (maria_log_remove(maria_data_root))
|
||||
exit(1);
|
||||
|
||||
free(long_buffer);
|
||||
return (test(exit_status()));
|
||||
}
|
||||
|
||||
|
|
|
@ -191,6 +191,7 @@ int main(int argc __attribute__((unused)), char *argv[])
|
|||
|
||||
if (maria_log_remove(maria_data_root))
|
||||
exit(1);
|
||||
free(long_buffer);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,9 @@ main(int argc __attribute__((unused)),char *argv[])
|
|||
diag("src length: %.8x, dst length: %.8x\n",
|
||||
(uint) src_len, (uint) dst_len);
|
||||
}
|
||||
free(dst);
|
||||
free(str);
|
||||
free(src);
|
||||
}
|
||||
my_end(0);
|
||||
return exit_status();
|
||||
|
|
Loading…
Reference in a new issue