Commit e8bcc6f1 authored by Stig Bjørlykke's avatar Stig Bjørlykke Committed by Jukka Rissanen
Browse files

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: default avatarStig Bjørlykke <stig.bjorlykke@nordicsemi.no>
parent edc048e0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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)