summaryrefslogtreecommitdiff
path: root/lib/xfrm
diff options
context:
space:
mode:
authorNicolas PLANEL <nicolas.planel@enovance.com>2014-08-26 11:31:15 -0400
committerThomas Haller <thaller@redhat.com>2014-08-27 12:59:39 +0200
commit77bbf2270ce7c166c87933dc2d70e9619bf6b6e3 (patch)
treed92b2e230f2fb4f70fe4c83525adaef8fa6fdcc2 /lib/xfrm
parenta640e97a2265ef241da0873593308907d71f1b3f (diff)
downloadlibnl-77bbf2270ce7c166c87933dc2d70e9619bf6b6e3.tar.gz
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>
Diffstat (limited to 'lib/xfrm')
-rw-r--r--lib/xfrm/ae.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/xfrm/ae.c b/lib/xfrm/ae.c
index a4db3002..4fe96472 100644
--- a/lib/xfrm/ae.c
+++ b/lib/xfrm/ae.c
@@ -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;