Deallocate the memory for the FILE structure when seeking to the end fails
in append mode.
Fixes: ea33158c96 ("Fix offset caching for streams and use it for ftell (BZ #16680)")
(cherry picked from commit
b2c3ee3724900975deaf5eae57640bb0c2d7315e)
(x86/tst-cpu-features-supports.c:69:3: error: parameter to builtin
not valid: avx5124fmaps)
[31798] pidfd_getpid.c is miscompiled by GCC 6.4
+ [31840] Remove memory leak in fdopen
[31867] build: "CPU ISA level is lower than required" on SSE2-free
CPUs
[31883] build: ISA level support configure check relies on bashism /
{
off64_t new_pos = _IO_SYSSEEK (&new_f->fp.file, 0, _IO_seek_end);
if (new_pos == _IO_pos_BAD && errno != ESPIPE)
- return NULL;
+ {
+ _IO_un_link (&new_f->fp);
+ free (new_f);
+ return NULL;
+ }
}
return &new_f->fp.file;
}