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

UTILS: fix names array memory leak #1073

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/utils/ucc_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ ucc_status_t ucc_config_names_array_dup(ucc_config_names_array_t *dst,
{
int i;

if (dst->count != 0) {
ucc_config_names_array_free(dst);
}
dst->names = ucc_malloc(sizeof(char*) * src->count, "ucc_config_names_array");
if (!dst->names) {
ucc_error("failed to allocate %zd bytes for ucc_config_names_array",
Expand Down Expand Up @@ -267,6 +270,7 @@ void ucc_config_names_array_free(ucc_config_names_array_t *array)
free(array->names[i]);
}
ucc_free(array->names);
array->count = 0;
}

int ucc_config_names_search(const ucc_config_names_array_t *config_names,
Expand Down
Loading