Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing some leaks in src/Monitor.c code #204

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

jcfaracco
Copy link
Contributor

This patchset proposes some fixes for:

  • A double free of monitoredProcessMap in MonitorProcesses() due to an auto_free variable and several free() calls.
  • Missing va_end call when GetClientDataHelper() finished early.

Most of these errors were reported by GCC 13 and they seem reasonable.

GCC 13 is reporting a double free occurence of monitoredProcessMap. It
is possible by using `-Werror=analyzer-double-free`. The variable
`monitoredProcessMap` is defined as a auto_free which does not require
an explicit `free()`.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
If the `clientData` cannot be allocated, it finishes the function
earlier, in order to complete the execution properly, the variables
need to be ended with `va_end` either.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
@MarioHewardt MarioHewardt self-requested a review August 28, 2023 16:13
@MarioHewardt MarioHewardt merged commit 790acf6 into microsoft:master Aug 28, 2023
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