From: Zbigniew Jędrzejewski-Szmek Date: Fri, 26 Dec 2014 14:02:01 +0000 (-0500) Subject: journald: always allocate space for object fields X-Git-Tag: v219~812 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=92ee6447b1deef7c79962a8121fdf8e58acb3a83 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(). --- diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index e99475255..b0120ef5f 100644 --- a/src/journal/journald-native.c +++ b/src/journal/journald-native.c @@ -135,7 +135,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; }