Skip to content

Commit

Permalink
Fix vasprintf implementation
Browse files Browse the repository at this point in the history
A va_copy call must be followed by a va_end call.

Signed-off-by: Samanta Navarro <[email protected]>
  • Loading branch information
ferivoz committed May 5, 2023
1 parent 812eb5b commit c483196
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ static int vasprintf(char **strp, const char *fmt, va_list va)
va_list vacopy;

va_copy(vacopy, va);

length = vsnprintf(NULL, 0, fmt, vacopy);
va_end(vacopy);
if (length < 0)
return length;

Expand Down

0 comments on commit c483196

Please sign in to comment.