Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
21c742d2
Commit
21c742d2
authored
Nov 27, 2017
by
Ulrich Sibiller
Committed by
Mihai Moldovan
Dec 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nxcomp: simplify free calls
free() can handle NULL itself
parent
513aa23a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ChannelEndPoint.cpp
nxcomp/src/ChannelEndPoint.cpp
+3
-3
No files found.
nxcomp/src/ChannelEndPoint.cpp
View file @
21c742d2
...
@@ -58,7 +58,7 @@ ChannelEndPoint::~ChannelEndPoint()
...
@@ -58,7 +58,7 @@ ChannelEndPoint::~ChannelEndPoint()
void
void
ChannelEndPoint
::
setSpec
(
const
char
*
spec
)
{
ChannelEndPoint
::
setSpec
(
const
char
*
spec
)
{
if
(
spec_
)
free
(
spec_
);
free
(
spec_
);
if
(
spec
&&
strlen
(
spec
))
if
(
spec
&&
strlen
(
spec
))
{
{
...
@@ -90,7 +90,7 @@ void
...
@@ -90,7 +90,7 @@ void
ChannelEndPoint
::
setSpec
(
const
char
*
hostName
,
long
port
)
{
ChannelEndPoint
::
setSpec
(
const
char
*
hostName
,
long
port
)
{
int
length
;
int
length
;
if
(
spec_
)
free
(
spec_
);
free
(
spec_
);
spec_
=
NULL
;
spec_
=
NULL
;
isUnix_
=
false
;
isUnix_
=
false
;
...
@@ -162,7 +162,7 @@ ChannelEndPoint::setDefaultTCPInterface(int publicInterface) {
...
@@ -162,7 +162,7 @@ ChannelEndPoint::setDefaultTCPInterface(int publicInterface) {
void
void
ChannelEndPoint
::
setDefaultUnixPath
(
char
*
path
)
{
ChannelEndPoint
::
setDefaultUnixPath
(
char
*
path
)
{
if
(
defaultUnixPath_
)
free
(
defaultUnixPath_
);
free
(
defaultUnixPath_
);
if
(
path
&&
strlen
(
path
))
if
(
path
&&
strlen
(
path
))
defaultUnixPath_
=
strdup
(
path
);
defaultUnixPath_
=
strdup
(
path
);
...
...
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