aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2017-04-03 12:22:55 +0000
committerMartin Matuska <mm@FreeBSD.org>2017-04-03 12:22:55 +0000
commit659b8836cb5cd1ff479c8644211f190e1ad9619d (patch)
tree85519890ca3e772cf952aa3606b405a32fddb330
parent838c5c42c203c680c01b759d324976dc68e6199b (diff)
downloadsrc-659b8836cb5cd1ff479c8644211f190e1ad9619d.tar.gz
src-659b8836cb5cd1ff479c8644211f190e1ad9619d.zip
Update vendor/libarchive to git 500a62194a1faafaffd286f6da50633e86587f3c
Vendor changes (FreeBSD-related): Plug memory leaks in xattr tests.
Notes
Notes: svn path=/vendor/libarchive/dist/; revision=316455
-rw-r--r--libarchive/test/test_xattr_platform.c6
-rw-r--r--tar/test/test_option_acls.c4
-rw-r--r--tar/test/test_option_xattrs.c3
-rw-r--r--test_utils/test_common.h2
-rw-r--r--test_utils/test_main.c4
5 files changed, 12 insertions, 7 deletions
diff --git a/libarchive/test/test_xattr_platform.c b/libarchive/test/test_xattr_platform.c
index ebb265edb382..df3f81a5b3fd 100644
--- a/libarchive/test/test_xattr_platform.c
+++ b/libarchive/test/test_xattr_platform.c
@@ -35,6 +35,7 @@ DEFINE_TEST(test_xattr_platform)
struct archive_entry *ae;
const char *name;
const void *value;
+ void *rvalue;
size_t size, insize;
int e, r;
const char *attrname = "user.libarchive.test";
@@ -95,8 +96,9 @@ DEFINE_TEST(test_xattr_platform)
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- value = getXattr("writetest", attrname, &insize);
+ rvalue = getXattr("writetest", attrname, &insize);
if (assertEqualInt(insize, strlen(writeval) + 1) != 0)
- assertEqualMem(value, writeval, insize);
+ assertEqualMem(rvalue, writeval, insize);
+ free(rvalue);
#endif
}
diff --git a/tar/test/test_option_acls.c b/tar/test/test_option_acls.c
index be0db449821a..f2d51d661abf 100644
--- a/tar/test/test_option_acls.c
+++ b/tar/test/test_option_acls.c
@@ -360,8 +360,10 @@ compare_acls(const char *path_a, const char *path_b)
if (richacl_a != NULL) {
richacl_b = richacl_get_file(path_b);
if (richacl_b == NULL &&
- (errno == ENODATA || errno == ENOTSUP || errno == ENOSYS))
+ (errno == ENODATA || errno == ENOTSUP || errno == ENOSYS)) {
+ richacl_free(richacl_a);
return (0);
+ }
failure("richacl_get_file() error: %s (%s)", path_b,
strerror(errno));
if (assert(richacl_b != NULL) == 0) {
diff --git a/tar/test/test_option_xattrs.c b/tar/test/test_option_xattrs.c
index 5095ce336d6c..bce8a94e4dd2 100644
--- a/tar/test/test_option_xattrs.c
+++ b/tar/test/test_option_xattrs.c
@@ -33,7 +33,7 @@ DEFINE_TEST(test_option_xattrs)
const char *testattr = "user.libarchive.test";
const char *testval = "testval";
- const void *readval;
+ void *readval;
size_t size;
int r;
@@ -62,6 +62,7 @@ DEFINE_TEST(test_option_xattrs)
readval = getXattr("xattrs_xattrs/f", testattr, &size);
if(assertEqualInt(size, strlen(testval) + 1) != 0)
assertEqualMem(readval, testval, size);
+ free(readval);
/* Extract xattrs without xattrs */
assertMakeDir("xattrs_noxattrs", 0755);
diff --git a/test_utils/test_common.h b/test_utils/test_common.h
index fa726bff1fde..1425dd84b7df 100644
--- a/test_utils/test_common.h
+++ b/test_utils/test_common.h
@@ -348,7 +348,7 @@ int canNodump(void);
int setTestAcl(const char *path);
/* Get extended attribute */
-const void *getXattr(const char *, const char *, size_t *);
+void *getXattr(const char *, const char *, size_t *);
/* Set extended attribute */
int setXattr(const char *, const char *, const void *, size_t);
diff --git a/test_utils/test_main.c b/test_utils/test_main.c
index 36dfc82fa08f..d74045934bec 100644
--- a/test_utils/test_main.c
+++ b/test_utils/test_main.c
@@ -2451,8 +2451,8 @@ canNodump(void)
return (0);
}
-/* Get extended attribute from a path */
-const void *
+/* Get extended attribute value from a path */
+void *
getXattr(const char *path, const char *name, size_t *sizep)
{
void *value = NULL;