[Ocfs2-tools-devel] [PATCH] o2info: avoid missing va_end

Sunil Mushran sunil.mushran at oracle.com
Mon Sep 19 08:59:19 PDT 2011


I am unclear as to why this takes in variable args in the first place.

Tristan?

On 09/19/2011 07:33 AM, chuanchang.jia at gmail.com wrote:
> o2info/operations.c: Initializing va_list 'ap', but va_end was
> not called for 'ap'.
>
> Signed-off-by: Alex Jia<chuanchang.jia at gmail.com>
> ---
>   o2info/operations.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/o2info/operations.c b/o2info/operations.c
> index abaca15..5c393b4 100644
> --- a/o2info/operations.c
> +++ b/o2info/operations.c
> @@ -57,6 +57,7 @@ static void o2i_info(struct o2info_operation *op, const char *fmt, ...)
>   	fprintf(stdout, "%s Info: ", op->to_name);
>   	va_start(ap, fmt);
>   	vfprintf(stdout, fmt, ap);
> +	va_end(ap);
>
>   	return;
>   }
> @@ -68,6 +69,7 @@ static void o2i_error(struct o2info_operation *op, const char *fmt, ...)
>   	fprintf(stderr, "%s Error: ", op->to_name);
>   	va_start(ap, fmt);
>   	vfprintf(stderr, fmt, ap);
> +	va_end(ap);
>
>   	return;
>   }




More information about the Ocfs2-tools-devel mailing list