Here is the snippet of code:
output_data(const char *format, ...)
{
va_listargs;intlen;char*buf;va_start(args, format);if((len=vasprintf(&buf, format, args))==-1)return-1;output_datalen(buf, len);va_end(args);free(buf);return(len);
}
I am new to this so pardon my ignorance. I got rid of the error by moving va_end before return -1; However, since its still called is this a non-issue, or just a best practice, etc.?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Howdy,
I noticed we are getting this on one of our files.
Here is the snippet of code:
output_data(const char *format, ...)
I am new to this so pardon my ignorance. I got rid of the error by moving va_end before return -1; However, since its still called is this a non-issue, or just a best practice, etc.?
I am not sure but it seems to be a false positive. I have created https://trac.cppcheck.net/ticket/10369