journald: always allocate space for object fields

If OBJECT_PID= came as the last field, we would not reallocate the iovec to bigger size,
and fail the assertion later on in dispatch_message_real().

(cherry picked from commit 92ee6447b1)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2015-01-15 23:09:25 -05:00
parent d0459adb29
commit d19bec3b2a
+1 -1
View File
@@ -133,7 +133,7 @@ void server_process_native_message(
/* A property follows */
/* n existing properties, 1 new, +1 for _TRANSPORT */
if (!GREEDY_REALLOC(iovec, m, n + 2 + N_IOVEC_META_FIELDS + !!object_pid * N_IOVEC_OBJECT_FIELDS)) {
if (!GREEDY_REALLOC(iovec, m, n + 2 + N_IOVEC_META_FIELDS + N_IOVEC_OBJECT_FIELDS)) {
log_oom();
break;
}