mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-23 05:37:46 +00:00
unit_tests: fix malloc/delete mismatch
This commit is contained in:
parent
84dd674cd0
commit
3de7d52f7c
1 changed files with 1 additions and 1 deletions
|
@ -49,7 +49,7 @@ TEST(notify, works)
|
||||||
tmp = "/tmp";
|
tmp = "/tmp";
|
||||||
static const char *filename = "monero-notify-unit-test-XXXXXX";
|
static const char *filename = "monero-notify-unit-test-XXXXXX";
|
||||||
const size_t len = strlen(tmp) + 1 + strlen(filename);
|
const size_t len = strlen(tmp) + 1 + strlen(filename);
|
||||||
std::unique_ptr<char[]> name_template_((char*)malloc(len + 1));
|
std::unique_ptr<char[]> name_template_(new char[len + 1]);
|
||||||
char *name_template = name_template_.get();
|
char *name_template = name_template_.get();
|
||||||
ASSERT_TRUE(name_template != NULL);
|
ASSERT_TRUE(name_template != NULL);
|
||||||
snprintf(name_template, len + 1, "%s/%s", tmp, filename);
|
snprintf(name_template, len + 1, "%s/%s", tmp, filename);
|
||||||
|
|
Loading…
Reference in a new issue