Closed a memory leak during retrieval of xattr.

This commit is contained in:
Thomas Schmitt 2015-10-15 17:32:58 +02:00
parent da8ad0d2aa
commit 02a972a2d7

View File

@ -1609,8 +1609,14 @@ int attrs_cleanout_name(char *del_name, size_t *num_attrs, char **names,
size_t i, w; size_t i, w;
for (w = i = 0; i < *num_attrs; i++) { for (w = i = 0; i < *num_attrs; i++) {
if ((strcmp(names[i], del_name) == 0) ^ (flag & 1)) if ((strcmp(names[i], del_name) == 0) ^ (flag & 1)) {
if (names[i] != NULL)
free(names[i]);
if (values[i] != NULL)
free(values[i]);
names[i] = values[i] = NULL;
continue; continue;
}
if (w == i) { if (w == i) {
w++; w++;
continue; continue;