Avoid a leak in case the format has two 'I's
@@ -484,6 +484,7 @@ int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt, ...)
int RetVal = 0;
size_t buf_length;
size_t num_written;
+ int I_fmt_processed = 0;
#if EXCLUDE_WEB_SERVER == 0
memset(Chunk_Header, 0, sizeof(Chunk_Header));
@@ -491,7 +492,8 @@ int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt, ...)
va_start(argp, fmt);
while ((c = *fmt++)) {
#if EXCLUDE_WEB_SERVER == 0
- if (c == 'I') {
+ if (c == 'I' && !I_fmt_processed) {
+ I_fmt_processed = 1;
Instr = va_arg(argp, struct SendInstruction *);
if (Instr->ReadSendSize >= 0)
amount_to_be_read = Instr->ReadSendSize;
