[MXS-276] Memory leak of buffer in connection router readQuery Created: 2015-07-18 Updated: 2016-01-05 Resolved: 2016-01-05 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | readconnroute |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | 1.3.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | martin brampton (Inactive) | Assignee: | martin brampton (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
In certain circumstances relating to the backend server being unavailable, a good return is made without processing the buffer. However, the buffer is not freed. The caller cannot know to do anything - it appears that readQuery functions are always expected to dispose of the passed buffer. It may be sufficient to simply free the buffer. |
| Comments |
| Comment by martin brampton (Inactive) [ 2015-07-18 ] |
|
Return is at line 731. |
| Comment by martin brampton (Inactive) [ 2015-07-18 ] |
|
There is a somewhat similar problem at line 1384 of mysql_backend.c although in this case it is an error return. Again the caller does not know to free the passed buffer, and in the error situation (out of memory) the buffer is not freed. It may be correct to free the buffer. |