mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
Merge pull request #3197 from phomes/networkd-memleak
Fixes for memleaks in networkd and test
This commit is contained in:
commit
898a67bc2f
@ -70,7 +70,7 @@ int config_parse_duid_rawdata(
|
||||
for (;;) {
|
||||
int n1, n2, len, r;
|
||||
uint32_t byte;
|
||||
char *cbyte;
|
||||
_cleanup_free_ char *cbyte = NULL;
|
||||
|
||||
r = extract_first_word(&rvalue, &cbyte, ":", 0);
|
||||
if (r < 0) {
|
||||
|
@ -47,10 +47,12 @@ static void test_config_parse_duid_type(void) {
|
||||
static void test_config_parse_duid_rawdata_one(const char *rvalue, int ret, const DUID* expected) {
|
||||
DUID actual = {};
|
||||
int r;
|
||||
_cleanup_free_ char *d = NULL;
|
||||
|
||||
r = config_parse_duid_rawdata("network", "filename", 1, "section", 1, "lvalue", 0, rvalue, &actual, NULL);
|
||||
d = hexmem(actual.raw_data, actual.raw_data_len);
|
||||
log_info_errno(r, "\"%s\" → \"%s\" (%m)",
|
||||
rvalue, strnull(hexmem(actual.raw_data, actual.raw_data_len)));
|
||||
rvalue, strnull(d));
|
||||
assert_se(r == ret);
|
||||
if (expected) {
|
||||
assert_se(actual.raw_data_len == expected->raw_data_len);
|
||||
|
Loading…
Reference in New Issue
Block a user