aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-10-24 08:02:28 -0700
committerDamjan Marion <dmarion@me.com>2018-12-20 09:30:35 +0000
commitfe820689cf56e894ae5fa38f33a48b6960038033 (patch)
tree286947578c22dad417e8187b7f450c3232319e36
parent359db1e622c7046102853e1bb0505897711e1a33 (diff)
Trivial: fix src/plugins/map/test.c memory leak
Change-Id: Iabc8bcddd1b30a3b14f3cfd13b3c0b77a63028d6 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
-rw-r--r--src/plugins/map/test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/map/test.c b/src/plugins/map/test.c
index f3c893a7a31..a64a0f27fd8 100644
--- a/src/plugins/map/test.c
+++ b/src/plugins/map/test.c
@@ -25,13 +25,14 @@ get_domain(ip4_address_t * ip4_prefix, u8 ip4_prefix_len,
u8 ea_bits_len, u8 psid_offset,
u8 psid_length, u16 mtu, u8 flags)
{
- map_domain_t * d = malloc(sizeof(*d));
u8 suffix_len;
/* EA bits must be within the first 64 bits */
if (ea_bits_len > 0 && (ip6_prefix_len + ea_bits_len) > 64)
return NULL;
+ map_domain_t * d = malloc(sizeof(*d));
+
/* Init domain struct */
d->ip4_prefix.as_u32 = ip4_prefix->as_u32;
d->ip4_prefix_len = ip4_prefix_len;