[LU-6541] potential memory leak in gssd_get_krb5_machine_cred_list Created: 29/Apr/15 Updated: 19/Jul/15 Resolved: 19/Jul/15 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.8.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Colin Ian King | Assignee: | Dmitry Eremin (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 15.04 |
||
| Severity: | 1 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
static analysis by cppcheck has found a potential memory leak in gssd_get_krb5_machine_cred_list(): [lustre/utils/gss/krb5_util.c:918]: (error) Common realloc mistake: 'l' nulled but not freed upon failure listsize += listinc; The semantics of realloc are to return NULL when the allocation fails, but won't free the original allocation: "The realloc() function returns a pointer to the newly allocated memory, so, one needs to do something like: tmp = (char **)realloc(l, listsize * sizeof(char *)); |
| Comments |
| Comment by Gerrit Updater [ 19/Jul/15 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14814/ |
| Comment by Peter Jones [ 19/Jul/15 ] |
|
Landed for 2.8 |