Skip to content

Commit

Permalink
Merge pull request #6 from opensourcerouting/pathd_pcep_fix_counters_…
Browse files Browse the repository at this point in the history
…null_session

Fix for pcep counters show with null session
  • Loading branch information
sylane authored Apr 15, 2020
2 parents d1ad79e + 876d596 commit 35836dc
Showing 1 changed file with 6 additions and 4 deletions.
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);
}

0 comments on commit 35836dc

Please sign in to comment.