tests: socket: Free resources with freeaddrinfo

In Zephyr this has no effect because getaddrinfo() returns a pointer
to a static array, but Coverity scan checks for this pattern.

Coverity-CID: 185273
Coverity-CID: 185279

Fixes #7085
Fixes #7091

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
This commit is contained in:
Stig Bjørlykke 2018-04-20 08:24:15 +02:00 committed by Jukka Rissanen
parent edc048e06f
commit e8bcc6f1f0

View file

@ -21,6 +21,8 @@ void test_getaddrinfo_ok(void)
/* With a local dnsmasq server this request shall return 0. */
/* zassert_equal(ret, 0, "Invalid result"); */
freeaddrinfo(res);
}
void test_getaddrinfo_no_host(void)
@ -33,6 +35,8 @@ void test_getaddrinfo_no_host(void)
zassert_equal(ret, DNS_EAI_SYSTEM, "Invalid result");
zassert_equal(errno, EINVAL, "Invalid errno");
zassert_is_null(res, "ai_addr is not NULL");
freeaddrinfo(res);
}
void test_main(void)