Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
7e908634
Commit
7e908634
authored
Nov 06, 2004
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a bunch of memory leaks
parent
3bf76033
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
4 deletions
+33
-4
modules/misc/sap.c
modules/misc/sap.c
+33
-4
No files found.
modules/misc/sap.c
View file @
7e908634
...
...
@@ -211,11 +211,14 @@ struct intf_sys_t
static
int
InitSocket
(
intf_thread_t
*
p_intf
,
char
*
psz_address
,
int
i_port
);
#ifdef HAVE_ZLIB_H
static
int
Decompress
(
unsigned
char
*
psz_src
,
unsigned
char
**
_dst
,
int
i_len
);
static
void
FreeSDP
(
sdp_t
*
p_sdp
);
#endif
/* Detect multicast addresses */
static
int
ismult
(
char
*
);
#define FREE( p ) \
if( p ) { free( p ); (p) = NULL; }
/*****************************************************************************
* Open: initialize and create stuff
*****************************************************************************/
...
...
@@ -236,6 +239,9 @@ static int Open( vlc_object_t *p_this )
p_sys
->
pi_fd
=
NULL
;
p_sys
->
i_fd
=
0
;
/* FIXME */
p_sys
->
b_strict
=
VLC_FALSE
;
if
(
config_GetInt
(
p_intf
,
"sap-use-cache"
)
)
{
CacheLoad
(
p_intf
);
...
...
@@ -429,6 +435,8 @@ static void Run( intf_thread_t *p_intf )
/* Parse the packet */
ParseSAP
(
p_intf
,
p_buffer
,
i_read
);
free
(
p_buffer
);
}
}
...
...
@@ -495,6 +503,9 @@ static int Demux( demux_t *p_demux )
vlc_object_release
(
p_playlist
);
FreeSDP
(
p_sdp
);
free
(
psz_sdp
);
return
VLC_SUCCESS
;
}
...
...
@@ -641,8 +652,9 @@ static int ParseSAP( intf_thread_t *p_intf, uint8_t *p_buffer, int i_read )
else
{
p_intf
->
p_sys
->
pp_announces
[
i
]
->
i_last
=
mdate
();
FreeSDP
(
p_sdp
);
return
VLC_SUCCESS
;
}
return
VLC_SUCCESS
;
}
}
/* Add item */
...
...
@@ -696,7 +708,8 @@ sap_announce_t *CreateAnnounce( intf_thread_t *p_intf, uint16_t i_hash,
if
(
!
p_playlist
)
{
msg_Err
(
p_intf
,
"playlist not found"
);
/* FIXME : Free */
FREE
(
psz_value
);
free
(
p_sap
);
return
NULL
;
}
...
...
@@ -893,6 +906,8 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
{
asprintf
(
&
p_sdp
->
psz_uri
,
"%s://%s:%i"
,
psz_proto
,
psz_uri
,
i_port
);
}
FREE
(
psz_uri
);
FREE
(
psz_proto
);
return
VLC_SUCCESS
;
}
...
...
@@ -1026,8 +1041,6 @@ static sdp_t * ParseSDP( vlc_object_t *p_obj, char* psz_sdp )
return
p_sdp
;
}
#define FREE( p ) \
if( p ) { free( p ); (p) = NULL; }
/***********************************************************************
* ismult: returns true if we have a multicast address
...
...
@@ -1129,6 +1142,22 @@ static int Decompress( unsigned char *psz_src, unsigned char **_dst, int i_len )
}
#endif
static
void
FreeSDP
(
sdp_t
*
p_sdp
)
{
int
i
;
FREE
(
p_sdp
->
psz_sdp
);
FREE
(
p_sdp
->
psz_sessionname
);
FREE
(
p_sdp
->
psz_connection
);
FREE
(
p_sdp
->
psz_media
);
FREE
(
p_sdp
->
psz_uri
);
for
(
i
=
0
;
i
<
p_sdp
->
i_attributes
;
i
++
)
{
FREE
(
p_sdp
->
pp_attributes
[
i
]
);
}
free
(
p_sdp
);
}
static
int
RemoveAnnounce
(
intf_thread_t
*
p_intf
,
sap_announce_t
*
p_announce
)
{
msg_Err
(
p_intf
,
"remove not implemented"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment