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

Memory leaks in registry_probe.c #1269

Closed
mazkasa opened this issue Nov 15, 2018 · 3 comments
Closed

Memory leaks in registry_probe.c #1269

mazkasa opened this issue Nov 15, 2018 · 3 comments
Milestone

Comments

@mazkasa
Copy link

mazkasa commented Nov 15, 2018

I found a memory leak in registry_probe.c.

A temporary variable tmp is leaking in following codes
To fix this issue, append SEXP_free(tmp); after L477.

if (key_str != NULL) {
SEXP_t *tmp = SEXP_string_new(key_str, strlen(key_str));
if (operation == OVAL_OPERATION_EQUALS || operation == OVAL_OPERATION_CASE_INSENSITIVE_EQUALS || probe_entobj_cmp(ei->key_ent, tmp) == OVAL_RESULT_TRUE) {
collect_registry_key(ctx, hive_str, key_str, ei->name_ent, windows_view);
}
}
RegCloseKey(opened_key_handle);
return 0;

@matusmarhefka
Copy link
Member

@mazkasa Hello, are you planning to propose a PR with a fix?

@mazkasa
Copy link
Author

mazkasa commented Nov 21, 2018

@matusmarhefka Hello, I'll try it.

mazkasa pushed a commit to mazkasa/openscap that referenced this issue Nov 21, 2018
Memory leaks in registry_probe.c
@jan-cerny jan-cerny added this to the 1.3.1 milestone Nov 21, 2018
@jan-cerny
Copy link
Member

Fixed in #1276

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

No branches or pull requests

3 participants