Skip to content

Conversation

mrdrivingduck
Copy link
Contributor

Hi. The code logic palloc a CronTask structure array, but assigns it to a pointer of two-dimension array. So the space is subsequently used as a pointer array whose type is CronTask *, instead of a structure array. There is no error thrown yet because the size of a CronTask * pointer is much less than a CronTask structure, so only the front part of the whole allocated space is used and an out-of-bound will never happen. But it is actually no need to allocate so much memory that won't be used.

@marcocitus marcocitus merged commit 56b81fe into citusdata:main Aug 24, 2021
@marcocitus
Copy link
Contributor

Good catch! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants