Skip to content

readpos: avoid static data - #917

Open
ourairquality wants to merge 1 commit into
rtklibexplorer:mainfrom
ourairquality:readpos-static
Open

readpos: avoid static data#917
ourairquality wants to merge 1 commit into
rtklibexplorer:mainfrom
ourairquality:readpos-static

Conversation

@ourairquality

Copy link
Copy Markdown

Allocate the large function local data on the heap.

@rtklibexplorer

Copy link
Copy Markdown
Owner

AI review:
One issue: fp leaks if either malloc() fails. The goto done; on malloc failure jumps past fclose(fp) (which only runs after the while loop on the success path), so done: frees poss/stas but never closes the file handle. Suggest either fclose(fp) before that goto done, or move the fclose(fp) up right after the read loop's initial setup so it's not gated on the malloc path at all.

Allocate the large function local data on the heap.
@ourairquality

Copy link
Copy Markdown
Author

Good point, fixed.

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