From 60af7e19d13145b1f78ef8bdc014c5772966e8e9 Mon Sep 17 00:00:00 2001 From: Arne Redlich Date: Tue, 18 Feb 2014 20:22:11 +0100 Subject: [PATCH] rpc_read_from_socket: fix use-after-free due to missing return Spotted by clang analyzer. Signed-off-by: Arne Redlich --- lib/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/socket.c b/lib/socket.c index 037fbbe..055109a 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -210,6 +210,7 @@ static int rpc_read_from_socket(struct rpc_context *rpc) if (count < 0) { rpc_set_error(rpc, "Failed recvfrom: %s", strerror(errno)); free(buf); + return -1; } if (rpc_process_pdu(rpc, buf, count) != 0) { rpc_set_error(rpc, "Invalid/garbage pdu received from server. Ignoring PDU"); -- 2.34.1