[6/7] test: add missing va_end

Submitted by Rikard Falkeborn on April 28, 2019, 6:22 p.m.

Details

Message ID 20190428182255.5641-7-rikard.falkeborn@gmail.com
State Accepted
Series "Misc fixes found by cppcheck"
Commit b90c46f32103acb8c02cefbfd86d7caa49bec95c
Headers show

Commit Message

Rikard Falkeborn April 28, 2019, 6:22 p.m.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 test/zdtm/static/autofs.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/autofs.c b/test/zdtm/static/autofs.c
index c2e04771..f74bc35a 100644
--- a/test/zdtm/static/autofs.c
+++ b/test/zdtm/static/autofs.c
@@ -49,6 +49,7 @@  static char *xvstrcat(char *str, const char *fmt, va_list args)
 		if (new) {
 			va_copy(tmp, args);
 			ret = vsnprintf(new + offset, delta, fmt, tmp);
+			va_end(tmp);
 			if (ret >= delta) {
 				/* NOTE: vsnprintf returns the amount of bytes
 				 *                                  * to allocate. */

Comments

Dmitry Safonov April 29, 2019, 2:55 p.m.
On Sun, 28 Apr 2019 at 19:45, Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>

> ---
>  test/zdtm/static/autofs.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/test/zdtm/static/autofs.c b/test/zdtm/static/autofs.c
> index c2e04771..f74bc35a 100644
> --- a/test/zdtm/static/autofs.c
> +++ b/test/zdtm/static/autofs.c
> @@ -49,6 +49,7 @@ static char *xvstrcat(char *str, const char *fmt, va_list args)
>                 if (new) {
>                         va_copy(tmp, args);
>                         ret = vsnprintf(new + offset, delta, fmt, tmp);
> +                       va_end(tmp);
>                         if (ret >= delta) {
>                                 /* NOTE: vsnprintf returns the amount of bytes
>                                  *                                  * to allocate. */
> --
> 2.21.0
>
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu