1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

s4: Call va_end() after all va_start()/va_copy() calls.

This corrects the issues reaised in bug #6129, and some others that were not
originally identified.  It also accounts for some code that was in the original
bug report but appears to have since been made common between S3 and S4.

Thanks to Erik Hovland <erik@hovland.org> for the original bug report.
This commit is contained in:
Andrew Kroeger
2009-06-12 13:01:41 +02:00
committed by Andrew Bartlett
parent efe6552f0c
commit 71515ba190
4 changed files with 16 additions and 5 deletions

View File

@ -55,12 +55,9 @@ smbw_ref -- manipulate reference counts
******************************************************/
int smbw_ref(int client_fd, Ref_Count_Type type, ...)
{
va_list ap;
/* client id values begin at SMBC_BASE_FC. */
client_fd -= SMBC_BASE_FD;
va_start(ap, type);
switch(type)
{
case SMBW_RCT_Increment:
@ -73,9 +70,16 @@ int smbw_ref(int client_fd, Ref_Count_Type type, ...)
return smbw_ref_count[client_fd];
case SMBW_RCT_Set:
return (smbw_ref_count[client_fd] = va_arg(ap, int));
{
va_list ap;
int ret;
va_start(ap, type);
ret = (smbw_ref_count[client_fd] = va_arg(ap, int));
va_end(ap);
return ret;
}
}
va_end(ap);
/* never gets here */
return -1;