From 08de8baa4917b20644f9340452825bceadad6693 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 1 Jan 2023 13:28:58 +0100 Subject: libnetfs: Fix dereferencing NULL on memory shortage --- libnetfs/io-restrict-auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libnetfs/io-restrict-auth.c') diff --git a/libnetfs/io-restrict-auth.c b/libnetfs/io-restrict-auth.c index e1fe79da..4ee77356 100644 --- a/libnetfs/io-restrict-auth.c +++ b/libnetfs/io-restrict-auth.c @@ -48,6 +48,7 @@ netfs_S_io_restrict_auth (struct protid *user, { *newport = ports_get_right (newpi); *newporttype = MACH_MSG_TYPE_MAKE_SEND; + ports_port_deref (newpi); } else { @@ -56,6 +57,5 @@ netfs_S_io_restrict_auth (struct protid *user, err = ENOMEM; } - ports_port_deref (newpi); return err; } -- cgit v1.2.3