Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
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)
static
sdpplin_stream_t
*
sdpplin_parse_stream
(
char
**
data
)
{
sdpplin_stream_t
*
desc
=
malloc
(
sizeof
(
sdpplin_stream_t
))
;
char
*
buf
=
malloc
(
BUFLEN
)
;
char
*
decoded
=
malloc
(
BUFLEN
)
;
int
handled
;
sdpplin_stream_t
*
desc
;
char
*
buf
=
NULL
;
char
*
decoded
=
NULL
;
int
handled
;
if
(
!
desc
)
return
NULL
;
memset
(
desc
,
0
,
sizeof
(
sdpplin_stream_t
));
desc
=
calloc
(
1
,
sizeof
(
sdpplin_stream_t
)
);
if
(
!
desc
)
return
NULL
;
if
(
!
buf
)
goto
error
;
if
(
!
decoded
)
goto
error
;
buf
=
malloc
(
BUFLEN
);
if
(
!
buf
)
goto
error
;
decoded
=
malloc
(
BUFLEN
);
if
(
!
decoded
)
goto
error
;
if
(
filter
(
*
data
,
"m="
,
&
buf
,
BUFLEN
))
{
desc
->
id
=
strdup
(
buf
);
...
...
@@ -227,32 +233,36 @@ error:
return
NULL
;
}
sdpplin_t
*
sdpplin_parse
(
char
*
data
)
{
sdpplin_t
*
desc
=
malloc
(
sizeof
(
sdpplin_t
));
sdpplin_stream_t
*
stream
;
char
*
buf
=
NULL
;
char
*
decoded
=
NULL
;
int
handled
;
int
len
;
sdpplin_t
*
sdpplin_parse
(
char
*
data
)
{
sdpplin_t
*
desc
;
sdpplin_stream_t
*
stream
;
char
*
buf
;
char
*
decoded
;
int
handled
;
int
len
;
if
(
!
desc
)
return
NULL
;
buf
=
malloc
(
BUFLEN
);
if
(
!
buf
)
{
desc
=
calloc
(
1
,
sizeof
(
sdpplin_t
)
);
if
(
!
desc
)
return
NULL
;
buf
=
malloc
(
BUFLEN
);
if
(
!
buf
)
{
free
(
desc
);
return
NULL
;
}
decoded
=
malloc
(
BUFLEN
);
if
(
!
decoded
)
{
decoded
=
malloc
(
BUFLEN
);
if
(
!
decoded
)
{
free
(
buf
);
free
(
desc
);
return
NULL
;
}
desc
->
stream
=
NULL
;
memset
(
desc
,
0
,
sizeof
(
sdpplin_t
));
while
(
data
&&
*
data
)
{
handled
=
0
;
...
...
@@ -358,7 +368,8 @@ void sdpplin_free(sdpplin_t *description) {
free
(
description
->
stream
[
i
]
);
}
}
if
(
description
->
stream_count
)
free
(
description
->
stream
);
if
(
description
->
stream_count
)
free
(
description
->
stream
);
free
(
description
->
owner
);
free
(
description
->
session_name
);
...
...
@@ -375,5 +386,5 @@ void sdpplin_free(sdpplin_t *description) {
free
(
description
->
asm_rule_book
);
free
(
description
->
abstract
);
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