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
a69589d3
Commit
a69589d3
authored
Dec 12, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
realrtsp: fix potential memleaks.
parent
e7d54bc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
25 deletions
+36
-25
modules/access/rtsp/real_sdpplin.c
modules/access/rtsp/real_sdpplin.c
+36
-25
No files found.
modules/access/rtsp/real_sdpplin.c
View file @
a69589d3
...
@@ -115,16 +115,22 @@ static int filter(const char *in, const char *filter, char **out, size_t outlen)
...
@@ -115,16 +115,22 @@ static int filter(const char *in, const char *filter, char **out, size_t outlen)
static
sdpplin_stream_t
*
sdpplin_parse_stream
(
char
**
data
)
{
static
sdpplin_stream_t
*
sdpplin_parse_stream
(
char
**
data
)
{
sdpplin_stream_t
*
desc
=
malloc
(
sizeof
(
sdpplin_stream_t
))
;
sdpplin_stream_t
*
desc
;
char
*
buf
=
malloc
(
BUFLEN
)
;
char
*
buf
=
NULL
;
char
*
decoded
=
malloc
(
BUFLEN
)
;
char
*
decoded
=
NULL
;
int
handled
;
int
handled
;
if
(
!
desc
)
return
NULL
;
desc
=
calloc
(
1
,
sizeof
(
sdpplin_stream_t
)
);
memset
(
desc
,
0
,
sizeof
(
sdpplin_stream_t
));
if
(
!
desc
)
return
NULL
;
if
(
!
buf
)
goto
error
;
buf
=
malloc
(
BUFLEN
);
if
(
!
decoded
)
goto
error
;
if
(
!
buf
)
goto
error
;
decoded
=
malloc
(
BUFLEN
);
if
(
!
decoded
)
goto
error
;
if
(
filter
(
*
data
,
"m="
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
*
data
,
"m="
,
&
buf
,
BUFLEN
))
{
desc
->
id
=
strdup
(
buf
);
desc
->
id
=
strdup
(
buf
);
...
@@ -227,32 +233,36 @@ error:
...
@@ -227,32 +233,36 @@ error:
return
NULL
;
return
NULL
;
}
}
sdpplin_t
*
sdpplin_parse
(
char
*
data
)
{
sdpplin_t
*
desc
=
malloc
(
sizeof
(
sdpplin_t
));
sdpplin_t
*
sdpplin_parse
(
char
*
data
)
sdpplin_stream_t
*
stream
;
{
char
*
buf
=
NULL
;
sdpplin_t
*
desc
;
char
*
decoded
=
NULL
;
sdpplin_stream_t
*
stream
;
int
handled
;
char
*
buf
;
int
len
;
char
*
decoded
;
int
handled
;
int
len
;
if
(
!
desc
)
return
NULL
;
desc
=
calloc
(
1
,
sizeof
(
sdpplin_t
)
);
buf
=
malloc
(
BUFLEN
);
if
(
!
desc
)
if
(
!
buf
)
{
return
NULL
;
buf
=
malloc
(
BUFLEN
);
if
(
!
buf
)
{
free
(
desc
);
free
(
desc
);
return
NULL
;
return
NULL
;
}
}
decoded
=
malloc
(
BUFLEN
);
if
(
!
decoded
)
{
decoded
=
malloc
(
BUFLEN
);
if
(
!
decoded
)
{
free
(
buf
);
free
(
buf
);
free
(
desc
);
free
(
desc
);
return
NULL
;
return
NULL
;
}
}
desc
->
stream
=
NULL
;
desc
->
stream
=
NULL
;
memset
(
desc
,
0
,
sizeof
(
sdpplin_t
));
while
(
data
&&
*
data
)
{
while
(
data
&&
*
data
)
{
handled
=
0
;
handled
=
0
;
...
@@ -358,7 +368,8 @@ void sdpplin_free(sdpplin_t *description) {
...
@@ -358,7 +368,8 @@ void sdpplin_free(sdpplin_t *description) {
free
(
description
->
stream
[
i
]
);
free
(
description
->
stream
[
i
]
);
}
}
}
}
if
(
description
->
stream_count
)
free
(
description
->
stream
);
if
(
description
->
stream_count
)
free
(
description
->
stream
);
free
(
description
->
owner
);
free
(
description
->
owner
);
free
(
description
->
session_name
);
free
(
description
->
session_name
);
...
@@ -375,5 +386,5 @@ void sdpplin_free(sdpplin_t *description) {
...
@@ -375,5 +386,5 @@ void sdpplin_free(sdpplin_t *description) {
free
(
description
->
asm_rule_book
);
free
(
description
->
asm_rule_book
);
free
(
description
->
abstract
);
free
(
description
->
abstract
);
free
(
description
->
range
);
free
(
description
->
range
);
free
(
description
);
free
(
description
);
}
}
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