Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
cpp-libs
libnice
Commits
02c6238a
Commit
02c6238a
authored
Nov 14, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not do a strdup for nothing, which may lead to memleaks too
parent
8d20ca91
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
agent/agent.c
agent/agent.c
+2
-9
No files found.
agent/agent.c
View file @
02c6238a
...
@@ -1097,7 +1097,6 @@ static gboolean priv_add_remote_candidate (
...
@@ -1097,7 +1097,6 @@ static gboolean priv_add_remote_candidate (
{
{
Component
*
component
;
Component
*
component
;
NiceCandidate
*
candidate
;
NiceCandidate
*
candidate
;
gchar
*
username_dup
=
NULL
,
*
password_dup
=
NULL
;
gboolean
error_flag
=
FALSE
;
gboolean
error_flag
=
FALSE
;
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
NULL
,
&
component
))
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
NULL
,
&
component
))
...
@@ -1121,10 +1120,6 @@ static gboolean priv_add_remote_candidate (
...
@@ -1121,10 +1120,6 @@ static gboolean priv_add_remote_candidate (
}
}
else
{
else
{
/* case 2: add a new candidate */
/* case 2: add a new candidate */
if
(
username
)
username_dup
=
g_strdup
(
username
);
if
(
password
)
password_dup
=
g_strdup
(
password
);
candidate
=
nice_candidate_new
(
type
);
candidate
=
nice_candidate_new
(
type
);
if
(
candidate
)
{
if
(
candidate
)
{
...
@@ -1152,8 +1147,8 @@ static gboolean priv_add_remote_candidate (
...
@@ -1152,8 +1147,8 @@ static gboolean priv_add_remote_candidate (
candidate
->
transport
=
transport
;
candidate
->
transport
=
transport
;
candidate
->
priority
=
priority
;
candidate
->
priority
=
priority
;
candidate
->
username
=
username_dup
;
candidate
->
username
=
g_strdup
(
username
)
;
candidate
->
password
=
password_dup
;
candidate
->
password
=
g_strdup
(
password
)
;
if
(
foundation
)
if
(
foundation
)
g_strlcpy
(
candidate
->
foundation
,
foundation
,
NICE_CANDIDATE_MAX_FOUNDATION
);
g_strlcpy
(
candidate
->
foundation
,
foundation
,
NICE_CANDIDATE_MAX_FOUNDATION
);
...
@@ -1171,8 +1166,6 @@ static gboolean priv_add_remote_candidate (
...
@@ -1171,8 +1166,6 @@ static gboolean priv_add_remote_candidate (
if
(
error_flag
)
{
if
(
error_flag
)
{
if
(
candidate
)
if
(
candidate
)
nice_candidate_free
(
candidate
);
nice_candidate_free
(
candidate
);
g_free
(
username_dup
);
g_free
(
password_dup
);
return
FALSE
;
return
FALSE
;
}
}
...
...
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