Skip to content

memstream: reset ptr on vlc_memstream_close() error

Steve Lhomme requested to merge robUx4/vlc:memstream_is_null into master

It's easier to spot of NULL pointer dereference than a use after free.

In the POSIX implementation [1] the status of the pointer is undefined on error. In our implementation it's free'd.

In both cases it's better some to use that pointer value after exiting vlc_memstream_close().

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/open_memstream.html

Formerly found in !4585 (closed)

Merge request reports