Skip to content

Free memory allocated for storing pdname and runtime logs #111

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

quic-ansa
Copy link

There is a memory leak of 120 bytes every time handle open is requested for staticpd and function returns without freeing memory allocated for storing pdname in uri. Similarly 256 bytes of memory leaked with runtime logging buffer. Free this allocated memory before returning from function.

There is a memory leak of 120 bytes every time handle open is
requested for staticpd and function returns without freeing memory
allocated for storing pdname in uri. Similarly 256 bytes of memory
leaked with runtime logging buffer. Free this allocated memory
before returning from function.

Signed-off-by: Ansa Ahmed <[email protected]>
@@ -1660,7 +1660,7 @@ int remote_handle_open_domain(int domain, const char *name, remote_handle *ph,
} else if (!std_strncmp(pdName, "oispd", std_strlen("oispd"))) {
hlist[domain].dsppd = OIS_STATICPD;
}
return AEE_SUCCESS;
goto free_buffer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use 'bail' only instead of new 'free_buffer' jump instructions ?

Minimize 'goto' statements for better readability and maintainability.

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.

3 participants