patch-2.4.22 linux-2.4.22/drivers/net/ppp_generic.c

Next file: linux-2.4.22/drivers/net/pppoe.c
Previous file: linux-2.4.22/drivers/net/ppp_deflate.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/drivers/net/ppp_generic.c linux-2.4.22/drivers/net/ppp_generic.c
@@ -666,8 +666,10 @@
 			if (code == 0)
 				break;
 			err = -EFAULT;
-			if (copy_from_user(code, uprog.filter, len))
+			if (copy_from_user(code, uprog.filter, len)) {
+				kfree(code);
 				break;
+			}
 			err = sk_chk_filter(code, uprog.len);
 			if (err) {
 				kfree(code);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)