Navigation Menu

Skip to content

Commit

Permalink
Coverity issues in contrail-controller/cfg_mirror.cc
Browse files Browse the repository at this point in the history
I have run Coverity on branch R5.0 and it reported the following issues
in contrail-controller/cfg_mirror.cc:
- Variable entry going out of scope leaks the storage it points to in
cfg_mirror.cc:MirrorCfgTable::Add
- Variable entry going out of scope leaks the storage it points to in
cfg_mirror.cc:IntfMirrorCfgTable::Add

Indeed, in both functions listed above, variable entry is not freed on
else branch.

Change-Id: Ia083a3976bd1259e415195ae916a8dd377d50ffc
Closes-Bug: #1770158
Signed-off-by: Anda Nicolae <anicolae@lenovo.com>
  • Loading branch information
Anda Nicolae committed May 14, 2018
1 parent 144a07b commit 2147207
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vnsw/agent/cfg/cfg_mirror.cc
Expand Up @@ -138,6 +138,7 @@ const char *MirrorCfgTable::Add(const MirrorCreateReq &cfg) {
cfg.get_vni(), mirror_flag,
MacAddress::ZeroMac());
} else {
delete entry;
return "Mode not supported";
}

Expand Down Expand Up @@ -512,6 +513,7 @@ const char *IntfMirrorCfgTable::Add(const IntfMirrorCreateReq &intf_mirror) {
intf_mirror.get_vni(), mirror_flag,
MacAddress::ZeroMac());
} else {
delete entry;
return "not supported";
}
intf_update:
Expand Down

0 comments on commit 2147207

Please sign in to comment.