xfrm: fix an unintialized return value on memory allocation error in xfrmnl_ae_parse()
fix : err = -ENOMEM if calloc() failed Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
a640e97a22
commit
77bbf2270c
1 changed files with 3 additions and 1 deletions
|
@ -533,8 +533,10 @@ int xfrmnl_ae_parse(struct nlmsghdr *n, struct xfrmnl_ae **result)
|
|||
struct xfrm_replay_state_esn* esn = nla_data (tb[XFRMA_REPLAY_ESN_VAL]);
|
||||
uint32_t len = sizeof (struct xfrmnl_replay_state_esn) + (sizeof (uint32_t) * esn->bmp_len);
|
||||
|
||||
if ((ae->replay_state_esn = calloc (1, len)) == NULL)
|
||||
if ((ae->replay_state_esn = calloc (1, len)) == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto errout;
|
||||
}
|
||||
ae->replay_state_esn->oseq = esn->oseq;
|
||||
ae->replay_state_esn->seq = esn->seq;
|
||||
ae->replay_state_esn->oseq_hi = esn->oseq_hi;
|
||||
|
|
Loading…
Add table
Reference in a new issue