]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Free memory correctly when braces used in parser
authorDon Slice <dslice@cumulusnetworks.com>
Tue, 26 Jul 2016 13:44:39 +0000 (06:44 -0700)
committerDon Slice <dslice@cumulusnetworks.com>
Tue, 26 Jul 2016 19:32:53 +0000 (12:32 -0700)
When braces (optional parameters) are used in the quagga parser, there
was a small leak on every iteration.  Since this construct is primarily
used in the configuation process rather than show commands, it was not
readily apparent.  With the addition of the "show ip bgp {json}" form of
the commands, each time one was run, memory was leaked.

Ticket: CM-11435
Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing, bgp-min and bgp-smoke successful

lib/command.c

index eea4fc19608dff1f88eda4b537457d8a4cdbd8f4..b3819048e59cf5bfd117c9f8e010d55fc5e3b354 100644 (file)
@@ -1427,6 +1427,7 @@ cmd_matcher_build_keyword_args(struct cmd_matcher *matcher,
             {
               word_token = vector_slot(keyword_vector, 0);
               arg = word_token->cmd;
+              XFREE (MTYPE_TMP, keyword_args);
             }
           else
             {