mirror of
https://github.com/transmission/transmission
synced 2025-01-31 11:23:40 +00:00
(libT) #1178: Add missing va_end()s
This commit is contained in:
parent
e8ec19530b
commit
aac6a6fdbf
2 changed files with 10 additions and 2 deletions
|
@ -50,6 +50,7 @@ tr_sha1( uint8_t * setme,
|
|||
break;
|
||||
SHA1_Update( &sha, content, content_len );
|
||||
}
|
||||
va_end( vl );
|
||||
SHA1_Final( setme, &sha );
|
||||
}
|
||||
|
||||
|
|
|
@ -543,10 +543,13 @@ tr_mkdirp( const char * path_in, int permissions )
|
|||
void
|
||||
tr_buildPath ( char *buf, size_t buflen, const char *first_element, ... )
|
||||
{
|
||||
struct evbuffer * evbuf = evbuffer_new( );
|
||||
struct evbuffer * evbuf;
|
||||
const char * element = first_element;
|
||||
va_list vl;
|
||||
|
||||
evbuf = evbuffer_new( );
|
||||
va_start( vl, first_element );
|
||||
|
||||
while( element ) {
|
||||
if( EVBUFFER_LENGTH(evbuf) )
|
||||
evbuffer_add_printf( evbuf, "%c", TR_PATH_DELIMITER );
|
||||
|
@ -557,6 +560,8 @@ tr_buildPath ( char *buf, size_t buflen, const char *first_element, ... )
|
|||
tr_strlcpy( buf, (char*)EVBUFFER_DATA(evbuf), buflen );
|
||||
else
|
||||
*buf = '\0';
|
||||
|
||||
va_end( vl );
|
||||
evbuffer_free( evbuf );
|
||||
}
|
||||
|
||||
|
@ -671,10 +676,12 @@ tr_strdup_printf( const char * fmt, ... )
|
|||
|
||||
buf = evbuffer_new( );
|
||||
va_start( ap, fmt );
|
||||
|
||||
if( evbuffer_add_vprintf( buf, fmt, ap ) != -1 )
|
||||
ret = tr_strdup( (char*)EVBUFFER_DATA( buf ) );
|
||||
evbuffer_free( buf );
|
||||
|
||||
va_end( ap );
|
||||
evbuffer_free( buf );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue