summaryrefslogtreecommitdiff
path: root/common/pieceinf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/pieceinf.cpp')
-rw-r--r--common/pieceinf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/pieceinf.cpp b/common/pieceinf.cpp
index eee37e4..45ea2ce 100644
--- a/common/pieceinf.cpp
+++ b/common/pieceinf.cpp
@@ -350,7 +350,7 @@ void PieceInfo::LoadInformation()
// Read connections
m_nConnectionCount = LCUINT16(*((lcuint16*)bytes));
bytes += sizeof (lcuint16);
- m_pConnections = (CONNECTIONINFO*)malloc (m_nConnectionCount * sizeof(CONNECTIONINFO));
+ m_pConnections = (CONNECTIONINFO*)malloc((m_nConnectionCount+1) * sizeof(CONNECTIONINFO));
sh = m_nConnectionCount;
for (pConnection = m_pConnections; sh--; pConnection++)