Skip to content

Commit

Permalink
check if entryList is empty instead of checking "if (fe)" since the b…
Browse files Browse the repository at this point in the history
…ehavior of front() can be undefined if the vec is empty

Signed-off-by: Gautam Venkataramanan <gautam.chennai@gmail.com>
  • Loading branch information
gautvenk committed May 27, 2020
1 parent afd403e commit 0c1f33d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions agent-ovs/ovs/test/include/PolicyStatsManagerFixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,8 @@ class PolicyStatsManagerFixture : public FlowManagerFixture {

// generate flow removed message for the first flow
// found in the flow entry list
const FlowEntryPtr& fe = entryList.front();
if (fe) {

if (!entryList.empty()) {
const FlowEntryPtr& fe = entryList.front();
fs = &fstat;
bzero(fs, sizeof(struct ofputil_flow_removed));
fs->table_id = table_id;
Expand Down

0 comments on commit 0c1f33d

Please sign in to comment.