Coverity Scan #23187. Variable 'half' is xmalloc'ed but not freed before
final return statement. Added xfree() for half before the return.

Signed-off-by: Morgan Stewart <[email protected]>
---
 str2prefix_rd-memory-leak.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 str2prefix_rd-memory-leak.patch

diff --git a/str2prefix_rd-memory-leak.patch b/str2prefix_rd-memory-leak.patch
new file mode 100644
index 0000000..f747516
--- /dev/null
+++ b/str2prefix_rd-memory-leak.patch
@@ -0,0 +1,12 @@
+diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
+index 3d2dade..9f54790 100644
+--- a/bgpd/bgp_mplsvpn.c
++++ b/bgpd/bgp_mplsvpn.c
+@@ -223,6 +223,7 @@ str2prefix_rd (const char *str, struct prefix_rd *prd)
+     }
+   memcpy (prd->val, s->data, 8);
+ 
++  XFREE (MTYPE_TMP, half);
+   return 1;
+ }
+ 
-- 
1.9.1


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to