daemon: xattr: Fix scope of cleanup buf to avoid memory leaks.

Found by ./configure --enable-valgrind-daemon.
This commit is contained in:
Richard W.M. Jones
2013-10-11 11:51:13 +01:00
parent 46304e9389
commit d8a8894cb2

View File

@@ -267,7 +267,6 @@ do_internal_lxattrlist (const char *path, char *const *names)
size_t i, j;
size_t k, m, nr_attrs;
ssize_t len, vlen;
CLEANUP_FREE char *buf = NULL;
ret = malloc (sizeof (*ret));
if (ret == NULL) {
@@ -281,6 +280,7 @@ do_internal_lxattrlist (const char *path, char *const *names)
for (k = 0; names[k] != NULL; ++k) {
void *newptr;
CLEANUP_FREE char *pathname = NULL;
CLEANUP_FREE char *buf = NULL;
/* Be careful in this loop about which errors cause the whole call
* to abort, and which errors allow us to continue processing