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
ce293647
Commit
ce293647
authored
Dec 27, 2017
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ChannelEndPoint.cpp: fix possible memleak in getUnixPath()
parent
17d04582
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
ChannelEndPoint.cpp
nxcomp/src/ChannelEndPoint.cpp
+5
-3
Loop.cpp
nxcomp/src/Loop.cpp
+1
-0
Proxy.cpp
nxcomp/src/Proxy.cpp
+1
-1
No files found.
nxcomp/src/ChannelEndPoint.cpp
View file @
ce293647
...
...
@@ -207,7 +207,10 @@ ChannelEndPoint::getPort(long *port) const {
bool
ChannelEndPoint
::
getUnixPath
(
char
**
unixPath
)
const
{
if
(
unixPath
)
*
unixPath
=
NULL
;
if
(
unixPath
)
*
unixPath
=
NULL
;
else
return
false
;
long
p
;
char
*
path
=
NULL
;
...
...
@@ -227,8 +230,7 @@ ChannelEndPoint::getUnixPath(char **unixPath) const {
return
false
;
}
if
(
unixPath
)
*
unixPath
=
strdup
(
path
);
*
unixPath
=
strdup
(
path
);
return
true
;
}
...
...
nxcomp/src/Loop.cpp
View file @
ce293647
...
...
@@ -6661,6 +6661,7 @@ int ConnectToRemote(ChannelEndPoint &socketAddress)
<<
"'.
\n
"
<<
std
::
flush
;
SAFE_FREE
(
hostName
);
SAFE_FREE
(
unixPath
);
if
(
socketAddress
.
getUnixPath
(
&
unixPath
))
result
=
PrepareProxyConnectionUnix
(
&
unixPath
,
&
connectTimeout
,
&
pFD
,
&
reason
);
...
...
nxcomp/src/Proxy.cpp
View file @
ce293647
...
...
@@ -6123,7 +6123,7 @@ int Proxy::handleNewSlaveConnection(int clientFd)
int
Proxy
::
handleNewGenericConnectionFromProxy
(
int
channelId
,
T_channel_type
type
,
ChannelEndPoint
&
endPoint
,
const
char
*
label
)
{
char
*
unixPath
,
*
host
=
NULL
;
char
*
unixPath
=
NULL
,
*
host
=
NULL
;
long
port
;
if
(
endPoint
.
getUnixPath
(
&
unixPath
))
{
...
...
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