diff options
author | Milan Lenco <milan.lenco@pantheon.tech> | 2017-04-05 14:42:42 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-04-05 15:34:19 +0000 |
commit | bf123dbedafd8f6d30b6e671d391ce7452ce45d8 (patch) | |
tree | 1b74e67ef91d97611f5afb0a01d7458d154cb311 /src/plugins/memif/memif.c | |
parent | 4b45e8f0ebe21be8df91a1c55a002ed200717ce1 (diff) |
Fix two more memif coverity issues
Change-Id: I935620798d6fe82b99b6bd564749e20a189b4ae3
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Diffstat (limited to 'src/plugins/memif/memif.c')
-rw-r--r-- | src/plugins/memif/memif.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c index f0d4aacded2..dc7ddd8a3c5 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; } |