free attribute set
| 413 | |
| 414 | // free attribute set |
| 415 | void AttributeSet_Free |
| 416 | ( |
| 417 | AttributeSet *set // set to be freed |
| 418 | ) { |
| 419 | ASSERT(set != NULL); |
| 420 | |
| 421 | AttributeSet _set = *set; |
| 422 | |
| 423 | // return if set is read-only |
| 424 | if(unlikely(ATTRIBUTE_SET_IS_READONLY(_set))) { |
| 425 | return; |
| 426 | } |
| 427 | |
| 428 | // return if set is NULL |
| 429 | if(_set == NULL) { |
| 430 | return; |
| 431 | } |
| 432 | |
| 433 | // free all allocated properties |
| 434 | for(uint16_t i = 0; i < _set->attr_count; ++i) { |
| 435 | SIValue_Free(_set->attributes[i].value); |
| 436 | } |
| 437 | |
| 438 | rm_free(_set); |
| 439 | *set = NULL; |
| 440 | } |
| 441 |
no test coverage detected