[dvblast-devel] add missing va_end()s
Christophe Massiot
git at videolan.org
Wed Oct 23 22:29:22 CEST 2013
dvblast | branch: master | Christophe Massiot <massiot at via.ecp.fr> | Wed Oct 23 21:35:38 2013 +0200| [039379c29f982a53ef6560dea3252c9ec240d663] | committer: Christophe Massiot
add missing va_end()s
(Spotted by Coverity: CID 1109741)
> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=039379c29f982a53ef6560dea3252c9ec240d663
---
demux.c | 1 +
dvblastctl.c | 2 ++
util.c | 5 +++++
3 files changed, 8 insertions(+)
diff --git a/demux.c b/demux.c
index 38e6a3b..361538c 100644
--- a/demux.c
+++ b/demux.c
@@ -1893,6 +1893,7 @@ static void demux_Print(void *_unused, const char *psz_format, ...)
if ( i_print_type != PRINT_XML )
strcat(psz_fmt, "\n");
vprintf(psz_fmt, args);
+ va_end(args);
}
/*****************************************************************************
diff --git a/dvblastctl.c b/dvblastctl.c
index 71f5a0b..5a44d52 100644
--- a/dvblastctl.c
+++ b/dvblastctl.c
@@ -86,6 +86,7 @@ static void psi_print(void *_unused, const char *psz_format, ...)
strcpy(psz_fmt, psz_format);
strcat(psz_fmt, "\n");
vprintf(psz_fmt, args);
+ va_end(args);
}
__attribute__ ((format(printf, 1, 2)))
@@ -103,6 +104,7 @@ void return_error( const char *psz_format, ... )
snprintf( psz_fmt, sizeof(psz_fmt) - 1, "ERROR: %s\n", psz_format );
psz_fmt[sizeof(psz_fmt) - 1] = '\0';
vfprintf( stderr, psz_fmt, args );
+ va_end(args);
exit(255);
}
diff --git a/util.c b/util.c
index d168e61..949c28e 100644
--- a/util.c
+++ b/util.c
@@ -83,6 +83,7 @@ void msg_Info( void *_unused, const char *psz_format, ... )
vsyslog( LOG_INFO, psz_fmt, args );
else
vfprintf( stderr, psz_fmt, args );
+ va_end(args);
}
}
@@ -102,6 +103,7 @@ void msg_Err( void *_unused, const char *psz_format, ... )
vsyslog( LOG_ERR, psz_fmt, args );
else
vfprintf( stderr, psz_fmt, args );
+ va_end(args);
}
}
@@ -121,6 +123,7 @@ void msg_Warn( void *_unused, const char *psz_format, ... )
vsyslog( LOG_WARNING, psz_fmt, args );
else
vfprintf( stderr, psz_fmt, args );
+ va_end(args);
}
}
@@ -140,6 +143,7 @@ void msg_Dbg( void *_unused, const char *psz_format, ... )
vsyslog( LOG_DEBUG, psz_fmt, args );
else
vfprintf( stderr, psz_fmt, args );
+ va_end(args);
}
}
@@ -157,6 +161,7 @@ void msg_Raw( void *_unused, const char *psz_format, ... )
vsyslog( LOG_NOTICE, psz_fmt, args );
else
vfprintf( stderr, psz_fmt, args );
+ va_end(args);
}
/*****************************************************************************
More information about the dvblast-devel
mailing list