utils_ovs: fix resource leaks
authorKavanagh, Mark B <mark.b.kavanagh@intel.com>
Tue, 27 Feb 2018 17:28:55 +0000 (17:28 +0000)
committerCiara Loftus <ciara.loftus@intel.com>
Tue, 27 Mar 2018 11:44:47 +0000 (12:44 +0100)
commitc836c3660921a52ebff47dccd81f21cf9962c30a
tree74ed3f29c46bf6f19a37d3387be9417f4a12fa2b
parent7858bf59eeed7b8769dd7258af7ea223e37287e4
utils_ovs: fix resource leaks

In ovs_db_init(), upon failure of either ovs_db_event_thread_init()
and/or ovs_db_poll_thread_init(), ovs_db_destroy() is invoked, in
order to release OVSDB data resources.

However, in the event that ovs_db_destroy() returns an error value,
some OVSDB resources are never released, and are consequently lost.

Resolve this issue by checking the return value of ovs_db_destroy()
and manually releasing the appropriate resources accordingly.

Fixes: 5a90d0e ("ovs_events: Address PR comments")
Signed-off-by: Kavanagh, Mark B <mark.b.kavanagh@intel.com>
src/utils_ovs.c