Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
f3aff699
Commit
f3aff699
authored
Jun 24, 2010
by
Bill King
Browse files
Fixes resource leak if lock not acquired.
parent
ce448b3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/3rdparty/net7ssh/src/ne7ssh.cpp
View file @
f3aff699
...
...
@@ -301,9 +301,9 @@ int ne7ssh::connectWithPassword (const char *host, const int port,
uint32
currentRecord
,
z
;
uint32
channelID
;
ne7ssh_connection
*
con
=
new
ne7ssh_connection
(
callbackFunc
,
callbackArg
);
if
(
!
lock
())
return
-
1
;
ne7ssh_connection
*
con
=
new
ne7ssh_connection
(
callbackFunc
,
callbackArg
);
if
(
!
conCount
)
connections
=
(
ne7ssh_connection
**
)
malloc
(
sizeof
(
ne7ssh_connection
*
));
else
connections
=
(
ne7ssh_connection
**
)
realloc
(
connections
,
sizeof
(
ne7ssh_connection
*
)
*
(
conCount
+
1
));
connections
[
conCount
++
]
=
con
;
...
...
@@ -354,8 +354,8 @@ int ne7ssh::connectWithKey (const char* host, const int port,
uint32
currentRecord
,
z
;
uint32
channelID
;
ne7ssh_connection
*
con
=
new
ne7ssh_connection
(
callbackFunc
,
callbackArg
);
if
(
!
lock
())
return
-
1
;
ne7ssh_connection
*
con
=
new
ne7ssh_connection
(
callbackFunc
,
callbackArg
);
if
(
!
conCount
)
connections
=
(
ne7ssh_connection
**
)
malloc
(
sizeof
(
ne7ssh_connection
*
)
*
(
conCount
+
1
));
else
connections
=
(
ne7ssh_connection
**
)
realloc
(
connections
,
sizeof
(
ne7ssh_connection
*
)
*
(
conCount
+
1
));
connections
[
conCount
++
]
=
con
;
...
...
src/libs/3rdparty/net7ssh/src/ne7ssh_error.cpp
View file @
f3aff699
...
...
@@ -137,7 +137,11 @@ bool Ne7sshError::push (int32 channel, const char* format, ...)
va_end
(
args
);
if
(
!
lock
())
return
false
;
if
(
!
lock
())
{
free
(
errStr
);
return
false
;
}
if
(
!
memberCount
)
{
ErrorBuffer
=
(
Error
**
)
malloc
(
sizeof
(
Error
*
));
...
...
Write
Preview
Supports
Markdown
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