Browse Source

modules: set VLC_MALLOC on strings allocated by a memstream

After vlc_memstream_close() the memstream cannot be used anymore.
pull/162/head
Steve Lhomme 2 years ago
parent
commit
e52cc89f80
  1. 2
      modules/access/http/message.h
  2. 4
      modules/access/smb2.c
  3. 2
      modules/demux/playlist/asx.c
  4. 2
      modules/keystore/kwallet.c
  5. 4
      modules/stream_out/es.c
  6. 4
      modules/stream_out/hls/hls.c

2
modules/access/http/message.h

@ -459,7 +459,7 @@ static inline void vlc_http_stream_close(struct vlc_http_stream *s, bool abort)
* or NULL on error
*/
char *vlc_http_msg_format(const struct vlc_http_msg *m, size_t *restrict lenp,
bool proxied, bool chunked) VLC_USED;
bool proxied, bool chunked) VLC_USED VLC_MALLOC;
/**
* Parses an HTTP 1.1 message header.

4
modules/access/smb2.c

@ -383,7 +383,7 @@ FileControl(stream_t *access, int i_query, va_list args)
return VLC_SUCCESS;
}
static char *
VLC_MALLOC static char *
vlc_smb2_get_url(vlc_url_t *url, const char *file)
{
/* smb2://<psz_host><i_port><psz_path><file>?<psz_option> */
@ -429,7 +429,7 @@ static int AddItem(stream_t *access, struct vlc_readdir_helper *rdh,
if (url == NULL)
return VLC_ENOMEM;
input_item_t *p_item;
input_item_t *p_item;
int ret = vlc_readdir_helper_additem(rdh, url, NULL, name, i_type,
ITEM_NET, &p_item);

2
modules/demux/playlist/asx.c

@ -437,7 +437,7 @@ static void memstream_puts_xmlencoded(struct vlc_memstream* p_stream, const char
* - make tags and attributes upercase
* - escape strings when required
*/
static char* ASXToXML( char* psz_source )
VLC_MALLOC static char* ASXToXML( char* psz_source )
{
bool b_in_string= false;
char *psz_source_cur = psz_source;

2
modules/keystore/kwallet.c

@ -108,7 +108,7 @@ typedef struct vlc_keystore_sys
/* takes all values in the values of vlc_keystore_entry *
* and formats them in a url key */
static char*
VLC_MALLOC static char*
values2key( const char* const* ppsz_values, bool b_search )
{
char* psz_b64_realm = NULL;

4
modules/stream_out/es.c

@ -62,8 +62,8 @@ typedef struct
bool synchronous;
} sout_stream_id_sys_t;
static char * es_print_url( const char *psz_fmt, vlc_fourcc_t i_fourcc, int i_count,
const char *psz_access, const char *psz_mux )
VLC_MALLOC static char * es_print_url( const char *psz_fmt, vlc_fourcc_t i_fourcc, int i_count,
const char *psz_access, const char *psz_mux )
{
struct vlc_memstream stream;
unsigned char c;

4
modules/stream_out/hls/hls.c

@ -213,8 +213,8 @@ static inline hls_track_t *MediaGetTrack(const hls_playlist_t *media_playlist)
return track;
}
static char *GeneratePlaylistCodecInfo(const struct vlc_list *media_list,
const hls_playlist_t *playlist)
VLC_MALLOC static char *GeneratePlaylistCodecInfo(const struct vlc_list *media_list,
const hls_playlist_t *playlist)
{
es_format_vec_t already_described = VLC_VECTOR_INITIALIZER;

Loading…
Cancel
Save