diff options
Diffstat (limited to 'net/ipv4/ip_options.c')
-rw-r--r-- | net/ipv4/ip_options.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 53e664444..b511e29fd 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c @@ -5,7 +5,7 @@ * * The options processing module for ip.c * - * Version: $Id: ip_options.c,v 1.19 2000/07/26 01:04:17 davem Exp $ + * Version: $Id: ip_options.c,v 1.20 2000/08/09 09:17:00 davem Exp $ * * Authors: A.N.Kuznetsov * @@ -498,8 +498,10 @@ int ip_options_get(struct ip_options **optp, unsigned char *data, int optlen, in memset(opt, 0, sizeof(struct ip_options)); if (optlen) { if (user) { - if (copy_from_user(opt->__data, data, optlen)) + if (copy_from_user(opt->__data, data, optlen)) { + kfree(opt); return -EFAULT; + } } else memcpy(opt->__data, data, optlen); } |