mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
kconfig: don't allocate n+1 elements in temporary array
The temporary array that stores the search results is not NULL-terminated, so there is no reason to allocate n+1 elements. Reported-by: Jean Delvare <[email protected]> Signed-off-by: "Yann E. MORIN" <[email protected]> Reviewed-by: Jean Delvare <[email protected]>
This commit is contained in:
parent
803b351988
commit
1407f97aed
1 changed files with 1 additions and 1 deletions
|
|
@ -1010,7 +1010,7 @@ struct symbol **sym_re_search(const char *pattern)
|
|||
continue;
|
||||
if (regexec(&re, sym->name, 1, match, 0))
|
||||
continue;
|
||||
if (cnt + 1 >= size) {
|
||||
if (cnt >= size) {
|
||||
void *tmp;
|
||||
size += 16;
|
||||
tmp = realloc(sym_match_arr, size * sizeof(struct sym_match *));
|
||||
|
|
|
|||
Loading…
Reference in a new issue