Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Conversation

@charlesUnixPro
Copy link
Contributor

Fix 'cppcheck' errors; add two va_end() calls on error exit.

@thefallentree
Copy link
Contributor

+1

Copy link
Contributor

@thefallentree thefallentree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, because va2 is not va_started , so it doesn't need to be va_end-ed.

Copy link
Contributor

@Shea690901 Shea690901 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excerpt from man va_copy:

Each invocation of va_copy() must be matched by a corresponding invocation of va_end() in the same function.

So this change is needed, but it is missing the va_end(va) for the original va_start(va)...

if (output == 0) {
_error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0,
"malloc() failed: %s", strerror(errno));
va_end(va2);
Copy link
Contributor

@Shea690901 Shea690901 May 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing va_end(va);
The same with the change further down....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants