swift-server / http

:warning: Historical HTTP API - please use https://github.com/swift-server/async-http-client instead
Apache License 2.0
703 stars 48 forks source link

Fix readBuffer memory leak #77

Closed chrisamanse closed 6 years ago

chrisamanse commented 6 years ago

Use defer statement to deallocate readBuffer pointer. Currently, it will not be deallocated when try strongSelf.socket?.socketRead(into: &readBuffer, maxLength:maxLength) fails, thus causing a memory leak.

seabaylea commented 6 years ago

Good catch @chrisamanse. Can you fix the merge conflict? If so, we'll get this in.

chrisamanse commented 6 years ago

Fixed merge conflict

seabaylea commented 6 years ago

All the macOS builds (for all projects) seem to be failing on Tavis at the moment. I'll merge this once that's fixed and we can get a clean build through.

seabaylea commented 6 years ago

We finally got Travis to complete a macOS build. Merging.