svn commit: r319155 - head/lib/libnv/tests
Ngie Cooper
ngie at FreeBSD.org
Mon May 29 18:34:46 UTC 2017
Author: ngie
Date: Mon May 29 18:34:45 2017
New Revision: 319155
URL: https://svnweb.freebsd.org/changeset/base/319155
Log:
lib/libnv/tests/dnv_test: fix memory leaks for memory allocated via
either strdup or one of the dnvlist* libcalls.
Reported by: Coverity
CID: 1362056-1362060
Sponsored by: Dell EMC Isilon
Modified:
head/lib/libnv/tests/dnv_tests.cc
Modified: head/lib/libnv/tests/dnv_tests.cc
==============================================================================
--- head/lib/libnv/tests/dnv_tests.cc Mon May 29 18:20:29 2017 (r319154)
+++ head/lib/libnv/tests/dnv_tests.cc Mon May 29 18:34:45 2017 (r319155)
@@ -391,6 +391,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_string__
ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0);
free(actual_val);
+ free(default_val);
nvlist_destroy(nvl);
}
@@ -408,6 +409,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_string__
ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0);
free(actual_val);
+ free(default_val);
nvlist_destroy(nvl);
}
@@ -496,6 +498,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__
free(actual_val);
free(default_val);
+ free(value);
nvlist_destroy(nvl);
}
@@ -515,6 +518,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__
ATF_REQUIRE_EQ(memcmp(actual_val, default_val, actual_size), 0);
free(actual_val);
+ free(default_val);
nvlist_destroy(nvl);
}
@@ -535,6 +539,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__
ATF_REQUIRE_EQ(memcmp(actual_val, default_val, default_size), 0);
free(actual_val);
+ free(default_val);
nvlist_destroy(nvl);
}
More information about the svn-src-head
mailing list