1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

Merge pull request #3197 from phomes/networkd-memleak

Fixes for memleaks in networkd and test
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-05-05 08:08:16 -04:00
commit 898a67bc2f
2 changed files with 4 additions and 2 deletions

View File

@ -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) {

View File

@ -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);