- MESSAGE_FOREACH_PART(part, i, m)
- if (part->memfd >= 0 && !part->sealed) {
- bus_body_part_unmap(part);
+ /* If this is something we can send as memfd, then let's seal
+ the memfd now. Note that we can send memfds as payload only
+ for directed messages, and not for broadcasts. */
+ if (m->destination) {
+ MESSAGE_FOREACH_PART(part, i, m)
+ if (part->memfd >= 0 && !part->sealed && part->size > MEMFD_MIN_SIZE) {
+ bus_body_part_unmap(part);