aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2017-11-15 16:00:38 -0800
committerSteven <sluong@cisco.com>2017-11-15 16:07:36 -0800
commit9d72120a6986e642c5b16c8650ad266188adf142 (patch)
tree8f71966bdaa8651e911fbfa0ff8fefdf30cec7c4 /src/plugins/memif
parent93149bb4cd0a137b2a6da4b0d9f8cb2032e44734 (diff)
memif: fix uninitialized pointer read coverity error
Set the content of tmp.sock prior to calling memif_msg_send_disconnect. Also fix the problem socket was not close in the same spot due to error encountered. Change-Id: I8f54ebad2250d1944afcc52e71d2a59da05362af Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/memif/socket.c b/src/plugins/memif/socket.c
index 23ea24902e3..9aa4a2e2e90 100644
--- a/src/plugins/memif/socket.c
+++ b/src/plugins/memif/socket.c
@@ -289,7 +289,9 @@ memif_msg_receive_init (memif_if_t ** mifp, memif_msg_t * msg,
return 0;
error:
+ tmp.sock = sock;
memif_msg_send_disconnect (&tmp, err);
+ memif_socket_close (&sock);
return err;
}