projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18503ca
)
path-util: add missing varargs cleanup
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Fri, 28 May 2021 10:38:34 +0000
(19:38 +0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Fri, 28 May 2021 10:38:37 +0000
(19:38 +0900)
Fixes CID#
1453293
.
src/basic/path-util.c
patch
|
blob
|
history
diff --git
a/src/basic/path-util.c
b/src/basic/path-util.c
index 2742a276728f54fa71c4b507f265b34fb7edfeaf..82f3709042771ec1786f3531f2d5d8349e803bfc 100644
(file)
--- 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));