The forcing of NULL on error is useful. Not checking the error on close is useful for readability, but it generates warnings because of
VLC_USED. And not using
VLC_USED might lead for forgetting checking the error. So I might drop these patches.
And since vlc_memstream_close() returns an allocated pointer, we may want to use
VideoLAN code repository instance