From e52cc89f8077c4cf264faabec470b09cd70d8d9a Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 24 Nov 2023 10:26:30 +0100 Subject: [PATCH] modules: set VLC_MALLOC on strings allocated by a memstream After vlc_memstream_close() the memstream cannot be used anymore. --- modules/access/http/message.h | 2 +- modules/access/smb2.c | 4 ++-- modules/demux/playlist/asx.c | 2 +- modules/keystore/kwallet.c | 2 +- modules/stream_out/es.c | 4 ++-- modules/stream_out/hls/hls.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/access/http/message.h b/modules/access/http/message.h index 80cf9d9150..f996387eec 100644 --- a/modules/access/http/message.h +++ b/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. diff --git a/modules/access/smb2.c b/modules/access/smb2.c index acf282311a..7f580f5ba7 100644 --- a/modules/access/smb2.c +++ b/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://? */ @@ -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); diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c index 6ccf89cd22..07552baa66 100644 --- a/modules/demux/playlist/asx.c +++ b/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; diff --git a/modules/keystore/kwallet.c b/modules/keystore/kwallet.c index 0f5705948a..f56bb12e3a 100644 --- a/modules/keystore/kwallet.c +++ b/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; diff --git a/modules/stream_out/es.c b/modules/stream_out/es.c index c73dc1bd60..bb8a98031c 100644 --- a/modules/stream_out/es.c +++ b/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; diff --git a/modules/stream_out/hls/hls.c b/modules/stream_out/hls/hls.c index 0a987e8497..206bb68d9c 100644 --- a/modules/stream_out/hls/hls.c +++ b/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;