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

Fix for pcep counters show with null session #6

Merged
merged 1 commit into from
Apr 15, 2020
Merged
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
10 changes: 6 additions & 4 deletions pathd/path_pcep_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ void pcep_lib_parse_capabilities(struct pcep_message *msg,

struct counters_group *pcep_lib_copy_counters(pcep_session *sess)
{
assert(NULL != sess);
assert(NULL != sess->pcep_session_counters);
if( !sess || !sess->pcep_session_counters) {
return NULL;
}

return copy_counter_group(sess->pcep_session_counters);
}

Expand Down Expand Up @@ -560,7 +562,7 @@ void free_counter_subgroup(struct counters_subgroup *subgroup)
{
int i;
if (NULL == subgroup)
return NULL;
return;
for (i = 0; i <= subgroup->num_counters; i++)
free_counter(subgroup->counters[i]);
XFREE(MTYPE_PCEP, subgroup);
Expand All @@ -569,6 +571,6 @@ void free_counter_subgroup(struct counters_subgroup *subgroup)
void free_counter(struct counter *counter)
{
if (NULL == counter)
return NULL;
return;
XFREE(MTYPE_PCEP, counter);
}