From 9d72120a6986e642c5b16c8650ad266188adf142 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 15 Nov 2017 16:00:38 -0800 Subject: 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 --- src/plugins/memif/socket.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/memif') 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; } -- cgit 1.2.3-korg