From: Arne Redlich Date: Tue, 18 Feb 2014 19:22:11 +0000 (+0100) Subject: rpc_read_from_socket: fix use-after-free due to missing return X-Git-Tag: upstream/1.9.6^2~87 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=60af7e19d13145b1f78ef8bdc014c5772966e8e9 rpc_read_from_socket: fix use-after-free due to missing return Spotted by clang analyzer. Signed-off-by: Arne Redlich --- 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");