Blob Blame History Raw
diff -up libtirpc-1.1.4/src/clnt_dg.c.orig libtirpc-1.1.4/src/clnt_dg.c
--- libtirpc-1.1.4/src/clnt_dg.c.orig	2022-05-31 08:14:09.408762537 -0400
+++ libtirpc-1.1.4/src/clnt_dg.c	2022-05-31 08:17:28.950764885 -0400
@@ -478,9 +478,9 @@ get_reply:
 		 cmsg = CMSG_NXTHDR (&msg, cmsg))
 	      if (cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_RECVERR)
 		{
-		  mem_free(cbuf, (outlen + 256));
 		  e = (struct sock_extended_err *) CMSG_DATA(cmsg);
 		  cu->cu_error.re_errno = e->ee_errno;
+		  mem_free(cbuf, (outlen + 256));
 		  release_fd_lock(cu->cu_fd, mask);
 		  return (cu->cu_error.re_status = RPC_CANTRECV);
 		}