[MXS-840] Return value of gwbuf_make_contiguous should be checked. Created: 2016-08-26 Updated: 2017-03-20 Resolved: 2017-03-20 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | N/A |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Johan Wikman | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Description |
|
A common pattern is
However, gwbuf_make_contiguous behaves like realloc, that is, the memory allocation can fail and the function can return NULL, in which case the original buffer will leak and the code will steam ahead towards a SIGSEGV. Correct way would be
|
| Comments |
| Comment by Johan Wikman [ 2017-03-20 ] |
|
A bit too general. |