]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/xattr.c
update configure
[bacula/bacula] / bacula / src / filed / xattr.c
index 0be8385ec0d04c66cbe1dc6623753200ba32f14a..5af66a3277e8e9a89c4069ef71f11231db3b4b43 100644 (file)
@@ -1302,18 +1302,6 @@ static bxattr_exit_code bsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt)
    for (namespace_index = 0; namespace_index < sizeof(os_default_xattr_namespaces) / sizeof(int); namespace_index++) {
       attrnamespace = os_default_xattr_namespaces[namespace_index];
 
-      /*
-       * Convert the numeric attrnamespace into a string representation and make a private copy of that string.
-       * The extattr_namespace_to_string functions returns a strdupped string which we need to free.
-       */
-      if (extattr_namespace_to_string(attrnamespace, &current_attrnamespace) != 0) {
-         Mmsg2(jcr->errmsg, _("Failed to convert %d into namespace on file \"%s\"\n"),
-               attrnamespace, jcr->last_fname);
-         Dmsg2(100, "Failed to convert %d into namespace on file \"%s\"\n",
-               attrnamespace, jcr->last_fname);
-         goto bail_out;
-      }
-
       /*
        * First get the length of the available list with extended attributes.
        * If we get EPERM on system namespace, don't return error.
@@ -1333,8 +1321,6 @@ static bxattr_exit_code bsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt)
 #endif
          case EPERM:
             if (attrnamespace == EXTATTR_NAMESPACE_SYSTEM) {
-               actuallyfree(current_attrnamespace);
-               current_attrnamespace = NULL;
                continue;
             }
             /*
@@ -1383,6 +1369,18 @@ static bxattr_exit_code bsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt)
       }
       xattr_list[xattr_list_len] = '\0';
 
+      /*
+       * Convert the numeric attrnamespace into a string representation and make a private copy of that string.
+       * The extattr_namespace_to_string functions returns a strdupped string which we need to free.
+       */
+      if (extattr_namespace_to_string(attrnamespace, &current_attrnamespace) != 0) {
+         Mmsg2(jcr->errmsg, _("Failed to convert %d into namespace on file \"%s\"\n"),
+               attrnamespace, jcr->last_fname);
+         Dmsg2(100, "Failed to convert %d into namespace on file \"%s\"\n",
+               attrnamespace, jcr->last_fname);
+         goto bail_out;
+      }
+
       /*
        * Walk the list of extended attributes names and retrieve the data.
        * We already count the bytes needed for serializing the stream later on.