From c681cc7a534588f2b7ad1de1b67a63372ff776ed Mon Sep 17 00:00:00 2001 From: Victor Grishchenko Date: Mon, 1 Feb 2010 14:08:32 +0100 Subject: [PATCH] added a safeguard --- swift.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/swift.cpp b/swift.cpp index 6d432c5..ee9f13c 100644 --- a/swift.cpp +++ b/swift.cpp @@ -107,8 +107,7 @@ void swift::Loop (tint till) { int swift::Open (const char* filename, const Sha1Hash& hash) { FileTransfer* ft = new FileTransfer(filename, hash); - int fdes = ft->file().file_descriptor(); - if (fdes>0) { + if (ft && ft->file().file_descriptor()) { /*if (FileTransfer::files.size()file().file_descriptor(); } else { - delete ft; + if (ft) + delete ft; return -1; } } @@ -185,9 +185,6 @@ const Sha1Hash& swift::RootMerkleHash (int file) { (channels are cheap and easily recycled)
  • a datagram must contain either the receiving channel id (scrambled) or the root hash -
  • initially, the control structure (p2tp_channel) - is mostly zeroed; intialization happens as - conversation progresses Note: */ -- 2.20.1