-
Notifications
You must be signed in to change notification settings - Fork 38
Memory leak in Davix 0.8.11 #145
Copy link
Copy link
Open
Description
Commit c47c9ee introduced a change moving a buffer from the stack into the heap. Unfortunately, between the call to malloc to allocate the buffer, and the call to free to release it, there is a place where an exception can be thrown and leak memory:
Lines 198 to 208 in 3054c82
| buffer = (char*)malloc(s_buff+1); | |
| const dav_ssize_t ret = req->readSegment(buffer, s_buff, &tmp_err); | |
| checkDavixError(&tmp_err); | |
| if(ret >= 0){ | |
| buffer[ret]= '\0'; | |
| parser->parseChunk(buffer, ret); | |
| }else{ | |
| throw DavixException(scope, StatusCode::UnknownError, "Unknown readSegment error"); | |
| } | |
| free(buffer); |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels