Make sure va_end() is called in http_MakeMessage().

(cherry picked from commit 8997e7fff61ba3a10421f560565268257cae61c8)
This commit is contained in:
Marcelo Roberto Jimenez 2011-01-02 22:31:10 -02:00
parent 7ec5511a8d
commit 8190adb3b9

View File

@ -1569,7 +1569,7 @@ int http_MakeMessage(membuffer *buf, int http_major_version,
const char *temp_str;
uri_type url;
uri_type *uri_ptr;
int error_code = UPNP_E_OUTOF_MEMORY;
int error_code = 0;
va_list argp;
char tempbuf[200];
const char *weekday_str = "Sun\0Mon\0Tue\0Wed\0Thu\0Fri\0Sat";
@ -1758,12 +1758,16 @@ int http_MakeMessage(membuffer *buf, int http_major_version,
assert(0);
}
}
goto ExitFunction;
return 0;
error_handler:
va_end(argp);
error_handler:
/* Default is out of memory error. */
if (!error_code)
error_code = UPNP_E_OUTOF_MEMORY;
membuffer_destroy(buf);
ExitFunction:
va_end(argp);
return error_code;
}