chiark / gitweb /
logind: implement generic multi-session
[elogind.git] / src / libsystemd-bus / bus-message.c
index 6f2f3e903987d7ff453d4d75a284b16a849726df..760a148fadd8f473f110d0a06589d8cdb4255cea 100644 (file)
@@ -125,8 +125,12 @@ static void message_free(sd_bus_message *m) {
         if (m->free_kdbus)
                 free(m->kdbus);
 
-        if (m->release_kdbus)
-                ioctl(m->bus->input_fd, KDBUS_CMD_MSG_RELEASE, m->kdbus);
+        if (m->release_kdbus) {
+                uint64_t off;
+
+                off = (uint8_t *)m->kdbus - (uint8_t *)m->bus->kdbus_buffer;
+                ioctl(m->bus->input_fd, KDBUS_CMD_MSG_RELEASE, &off);
+        }
 
         if (m->bus)
                 sd_bus_unref(m->bus);
@@ -1212,8 +1216,9 @@ static int part_make_space(
 
                         part->mapped = psz;
                         part->data = n;
-                        part->munmap_this = true;
                 }
+
+                part->munmap_this = true;
         } else {
                 n = realloc(part->data, sz);
                 if (!n) {