From: Yu Watanabe Date: Fri, 28 May 2021 10:38:34 +0000 (+0900) Subject: path-util: add missing varargs cleanup X-Git-Tag: v249-rc1~130^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50fd596efcd0f556104a05ba2c6a35400ae989eb;p=thirdparty%2Fsystemd.git path-util: add missing varargs cleanup Fixes CID#1453293. --- diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 2742a276728..82f37090427 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -577,12 +577,13 @@ char* path_extend_internal(char **x, ...) { continue; add = 1 + strlen(p); - if (sz > SIZE_MAX - add) /* overflow check */ + if (sz > SIZE_MAX - add) { /* overflow check */ + va_end(ap); return NULL; + } sz += add; } - va_end(ap); nx = realloc(x ? *x : NULL, GREEDY_ALLOC_ROUND_UP(sz+1));