From f7f4535510aa2abbe5ac20002d8b1e43c1c368df Mon Sep 17 00:00:00 2001 From: Milan Lenco Date: Wed, 5 Apr 2017 15:05:12 +0200 Subject: Fix two more memif coverity issues Change-Id: Iff7e1562d395f1f2e000fa8c2e98bb85969479d7 Signed-off-by: Milan Lenco --- src/plugins/memif/memif.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/plugins/memif/memif.c') diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c index 3ea95f3bb6e..f4358626dde 100644 --- a/src/plugins/memif/memif.c +++ b/src/plugins/memif/memif.c @@ -241,6 +241,7 @@ memif_process_connect_req (memif_pending_conn_t * pending_conn, uf->private_data = mif->if_index << 1; mif->connection = pending_conn->connection; pool_put (mm->pending_conns, pending_conn); + pending_conn = 0; memif_connect (vm, mif); @@ -252,7 +253,17 @@ response: { DEBUG_UNIX_LOG ("Failed to send connection response"); error = clib_error_return_unix (0, "send fd %d", fd); - memif_disconnect (vm, mif); + if (pending_conn) + memif_remove_pending_conn (pending_conn); + else + memif_disconnect (vm, mif); + } + if (retval > 0) + { + if (shm_fd >= 0) + close (shm_fd); + if (int_fd >= 0) + close (int_fd); } return error; } -- cgit 1.2.3-korg