@@ -1358,23 +1358,25 @@ mark_created_attrs(xmlNode *new_xml)
13581358 for (xmlAttr * attr = pcmk__xe_first_attr (new_xml ); attr != NULL ;
13591359 attr = attr -> next ) {
13601360
1361+ const char * name = (const char * ) attr -> name ;
13611362 xml_node_private_t * nodepriv = attr -> _private ;
13621363
1363- if (pcmk__is_set (nodepriv -> flags , pcmk__xf_created )) {
1364- const char * name = (const char * ) attr -> name ;
1364+ if (!pcmk__is_set (nodepriv -> flags , pcmk__xf_created )) {
1365+ continue ;
1366+ }
13651367
1366- pcmk__trace ("Created new attribute %s=%s in %s" , name ,
1367- pcmk__xml_attr_value (attr ), new_xml -> name );
1368+ pcmk__trace ("Created new attribute %s=%s in %s" , name ,
1369+ pcmk__xml_attr_value (attr ), ( const char * ) new_xml -> name );
13681370
1369- /* Check ACLs (we can't use the remove-then-create trick because it
1370- * would modify the attribute position).
1371- */
1372- if (pcmk__check_acl (new_xml , name , pcmk__xf_acl_write )) {
1373- pcmk__mark_xml_attr_dirty (attr );
1374- } else {
1375- // Creation was not allowed, so remove the attribute
1376- pcmk__xa_remove ( attr , true);
1377- }
1371+ /* Check ACLs (we can't use the remove-then-create trick because it
1372+ * would modify the attribute position).
1373+ */
1374+ if (pcmk__check_acl (new_xml , name , pcmk__xf_acl_write )) {
1375+ pcmk__mark_xml_attr_dirty (attr );
1376+
1377+ } else {
1378+ // Creation was not allowed, so remove the attribute
1379+ pcmk__xa_remove ( attr , true);
13781380 }
13791381 }
13801382}
0 commit comments