From: Yu Watanabe Date: Fri, 26 Apr 2024 02:31:48 +0000 (+0900) Subject: logs-show: use GREEDY_REALLOC_APPEND() X-Git-Tag: v256-rc2~50^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f2bcb1fb292c75b627d749c90283daf27c38eef;p=thirdparty%2Fsystemd.git logs-show: use GREEDY_REALLOC_APPEND() --- diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index 9851fd3646f..c96f501f0ef 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -2024,10 +2024,8 @@ int journal_get_boots(sd_journal *j, BootId **ret_boots, size_t *ret_n_boots) { * Exiting as otherwise this problem would cause an infinite loop. */ goto finish; - if (!GREEDY_REALLOC(boots, n_boots + 1)) + if (!GREEDY_REALLOC_APPEND(boots, n_boots, &boot, 1)) return -ENOMEM; - - boots[n_boots++] = boot; } finish: