title: Pointer being freed was not allocated [Swift]
body: <p>I am trying to read long length String in TCP socket connection . 
  For reading short length string it is working fine . but when i am trying to send long length base64 Encoded Image . it is crashing , i tried to increasing upto <code>maxReadLength = 10000</code> , but still it is not working .</p>
  
  <p><strong>Reading incoming message</strong> </p>
  
  <pre><code> private func readAvailableBytes(stream: InputStream) {
              let buffer = UnsafeMutablePointer&lt;UInt8&gt;.allocate(capacity: maxReadLength)
  
              while stream.hasBytesAvailable {
                  let numberOfBytesRead = inputStream.read(buffer, maxLength: maxReadLength)
  
                  if numberOfBytesRead &lt; 0 {
                      if let _ = inputStream.streamError {
                          break
                      }
                  }
  
             ❌ Crashing in  below line  ❌
  
                 if let reciviedMsg = String(bytesNoCopy: buffer,
                                           length: numberOfBytesRead,
                                           encoding: .ascii,
                                           freeWhenDone: true)
                 {
                     delegate?.scoktDidRecivceNewMessagew(message: reciviedMsg)
                  }
  
              }
          }
  </code></pre>
  
  <p><strong>Error</strong> </p>
  
  <pre><code>malloc: *** error for object 0x101890c00: pointer being freed was not allocated
  *** set a breakpoint in malloc_error_break to debug
  </code></pre>