Commit 3554bef0 authored by Norby, Tom's avatar Norby, Tom
Browse files

Memory management.

parent c8e1df9e
Pipeline #101215 passed with stages
in 7 minutes and 21 seconds
...@@ -261,6 +261,7 @@ QString SFTPFile::read(size_t nBytes) ...@@ -261,6 +261,7 @@ QString SFTPFile::read(size_t nBytes)
if (nBytesRead < 0) if (nBytesRead < 0)
{ {
close(); close();
delete[] buf;
return QString(); return QString();
} }
QString str(buf); QString str(buf);
......
...@@ -258,6 +258,7 @@ void SessionWorker::requestExec(QString command) ...@@ -258,6 +258,7 @@ void SessionWorker::requestExec(QString command)
{ {
radix_tagged_line("Failed to open channel"); radix_tagged_line("Failed to open channel");
emit execFailed("Failed to open a channel on the session."); emit execFailed("Failed to open a channel on the session.");
delete channel;
return; return;
} }
...@@ -267,6 +268,7 @@ void SessionWorker::requestExec(QString command) ...@@ -267,6 +268,7 @@ void SessionWorker::requestExec(QString command)
radix_tagged_line("Failed to request exec."); radix_tagged_line("Failed to request exec.");
emit execFailed("Failed to execute remote command."); emit execFailed("Failed to execute remote command.");
channel->close(); channel->close();
delete channel;
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment