Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
f5c082b5
Commit
f5c082b5
authored
Dec 02, 2013
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtsp: fix memory leaks and factorize (cid #1048938)
parent
dbf26164
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
modules/misc/rtsp.c
modules/misc/rtsp.c
+17
-16
No files found.
modules/misc/rtsp.c
View file @
f5c082b5
...
@@ -369,16 +369,15 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
...
@@ -369,16 +369,15 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
if
(
asprintf
(
&
p_media
->
psz_rtsp_path
,
"%s%s"
,
if
(
asprintf
(
&
p_media
->
psz_rtsp_path
,
"%s%s"
,
p_sys
->
psz_path
,
psz_name
)
<
0
)
p_sys
->
psz_path
,
psz_name
)
<
0
)
return
NULL
;
goto
error
;
p_media
->
p_rtsp_url
=
p_media
->
p_rtsp_url
=
httpd_UrlNew
(
p_sys
->
p_rtsp_host
,
p_media
->
psz_rtsp_path
,
NULL
,
NULL
);
httpd_UrlNew
(
p_sys
->
p_rtsp_host
,
p_media
->
psz_rtsp_path
,
NULL
,
NULL
);
if
(
!
p_media
->
p_rtsp_url
)
if
(
!
p_media
->
p_rtsp_url
)
{
{
msg_Err
(
p_vod
,
"cannot create RTSP url (%s)"
,
p_media
->
psz_rtsp_path
);
msg_Err
(
p_vod
,
"cannot create RTSP url (%s)"
,
p_media
->
psz_rtsp_path
);
free
(
p_media
->
psz_rtsp_path
);
goto
error
;
free
(
p_media
);
return
NULL
;
}
}
msg_Dbg
(
p_vod
,
"created RTSP url: %s"
,
p_media
->
psz_rtsp_path
);
msg_Dbg
(
p_vod
,
"created RTSP url: %s"
,
p_media
->
psz_rtsp_path
);
...
@@ -386,21 +385,12 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
...
@@ -386,21 +385,12 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
if
(
asprintf
(
&
p_media
->
psz_rtsp_control_v4
,
if
(
asprintf
(
&
p_media
->
psz_rtsp_control_v4
,
"rtsp://%%s:%%d%s/trackID=%%d"
,
"rtsp://%%s:%%d%s/trackID=%%d"
,
p_media
->
psz_rtsp_path
)
<
0
)
p_media
->
psz_rtsp_path
)
<
0
)
{
goto
error
;
httpd_UrlDelete
(
p_media
->
p_rtsp_url
);
free
(
p_media
->
psz_rtsp_path
);
free
(
p_media
);
return
NULL
;
}
if
(
asprintf
(
&
p_media
->
psz_rtsp_control_v6
,
if
(
asprintf
(
&
p_media
->
psz_rtsp_control_v6
,
"rtsp://[%%s]:%%d%s/trackID=%%d"
,
"rtsp://[%%s]:%%d%s/trackID=%%d"
,
p_media
->
psz_rtsp_path
)
<
0
)
p_media
->
psz_rtsp_path
)
<
0
)
{
goto
error
;
httpd_UrlDelete
(
p_media
->
p_rtsp_url
);
free
(
p_media
->
psz_rtsp_path
);
free
(
p_media
);
return
NULL
;
}
httpd_UrlCatch
(
p_media
->
p_rtsp_url
,
HTTPD_MSG_SETUP
,
httpd_UrlCatch
(
p_media
->
p_rtsp_url
,
HTTPD_MSG_SETUP
,
RtspCallback
,
(
void
*
)
p_media
);
RtspCallback
,
(
void
*
)
p_media
);
...
@@ -431,6 +421,17 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
...
@@ -431,6 +421,17 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
CommandPush
(
p_vod
,
RTSP_CMD_TYPE_ADD
,
p_media
,
NULL
,
0
,
0
.
0
,
NULL
);
CommandPush
(
p_vod
,
RTSP_CMD_TYPE_ADD
,
p_media
,
NULL
,
0
,
0
.
0
,
NULL
);
return
p_media
;
return
p_media
;
error:
if
(
p_media
)
{
free
(
p_media
->
psz_rtsp_control_v4
);
if
(
p_media
->
p_rtsp_url
)
httpd_UrlDelete
(
p_media
->
p_rtsp_url
);
free
(
p_media
->
psz_rtsp_path
);
free
(
p_media
);
}
return
NULL
;
}
}
static
void
MediaAskDel
(
vod_t
*
p_vod
,
vod_media_t
*
p_media
)
static
void
MediaAskDel
(
vod_t
*
p_vod
,
vod_media_t
*
p_media
)
...
...
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