mirror of
https://github.com/apache/nuttx.git
synced 2026-09-01 22:53:01 +00:00
lib/vasprintf: Shouldn't call va_end(ap) to avoid the double free
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I20e10803e7923fbbd8b5fdccca1fdb4c9d090434
This commit is contained in:
parent
cbb0f3483a
commit
7a017b5be0
1 changed files with 0 additions and 3 deletions
|
|
@ -93,7 +93,6 @@ int vasprintf(FAR char **ptr, FAR const IPTR char *fmt, va_list ap)
|
|||
buf = (FAR char *)lib_malloc(nulloutstream.nput + 1);
|
||||
if (!buf)
|
||||
{
|
||||
va_end(ap);
|
||||
#ifdef va_copy
|
||||
va_end(ap2);
|
||||
#endif
|
||||
|
|
@ -119,8 +118,6 @@ int vasprintf(FAR char **ptr, FAR const IPTR char *fmt, va_list ap)
|
|||
fmt, ap);
|
||||
#endif
|
||||
|
||||
va_end(ap);
|
||||
|
||||
/* Return a pointer to the string to the caller. NOTE: the memstream put()
|
||||
* method has already added the NUL terminator to the end of the string
|
||||
* (not included in the nput count).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue