Since x->encap of pfkey_msg2xfrm_state() is not
initialized to 0, kernel heap data can be leaked.
Fix with kzalloc() to prevent this.
Signed-off-by: Hyunwoo Kim <v4bel@theori.io>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
                const struct sadb_x_nat_t_type* n_type;
                struct xfrm_encap_tmpl *natt;
 
-               x->encap = kmalloc(sizeof(*x->encap), GFP_KERNEL);
+               x->encap = kzalloc(sizeof(*x->encap), GFP_KERNEL);
                if (!x->encap) {
                        err = -ENOMEM;
                        goto out;