diff mbox series

[ovs-dev] oss-fuzz: Free error string in ofctl_parse_flow

Message ID 1541097599-16182-1-git-send-email-pkusunyifeng@gmail.com
State Accepted
Headers show
Series [ovs-dev] oss-fuzz: Free error string in ofctl_parse_flow | expand

Commit Message

Yifeng Sun Nov. 1, 2018, 6:39 p.m. UTC
This patch frees the leaked free string to stop oss-fuzz from
complaining.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11161
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
---
 tests/oss-fuzz/ofctl_parse_target.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Yifeng Sun Nov. 1, 2018, 11:11 p.m. UTC | #1
Sorry, there is a typo in the message,
the leaked free string => the leaked error string
Ben, do you mind fixing it? Thanks.

Best,
Yifeng

On Thu, Nov 1, 2018 at 11:40 AM Yifeng Sun <pkusunyifeng@gmail.com> wrote:

> This patch frees the leaked free string to stop oss-fuzz from
> complaining.
>
> Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11161
> Signed-off-by
> <https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11161Signed-off-by>:
> Yifeng Sun <pkusunyifeng@gmail.com>
> ---
>  tests/oss-fuzz/ofctl_parse_target.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/oss-fuzz/ofctl_parse_target.c
> b/tests/oss-fuzz/ofctl_parse_target.c
> index 13d0899dbbae..8a906400a5cc 100644
> --- a/tests/oss-fuzz/ofctl_parse_target.c
> +++ b/tests/oss-fuzz/ofctl_parse_target.c
> @@ -58,6 +58,7 @@ ofctl_parse_flow(const char *input, int command)
>                                     command, &usable_protocols);
>      if (error) {
>          printf("Error encountered: %s\n", error);
> +        free(error);
>      } else {
>          ofctl_parse_flows__(&fm, 1, usable_protocols);
>      }
> --
> 2.7.4
>
>
Ben Pfaff Nov. 2, 2018, 6:32 p.m. UTC | #2
No problem.  I fixed that up and applied this to master.

On Thu, Nov 01, 2018 at 04:11:57PM -0700, Yifeng Sun wrote:
> Sorry, there is a typo in the message,
> the leaked free string => the leaked error string
> Ben, do you mind fixing it? Thanks.
> 
> Best,
> Yifeng
> 
> On Thu, Nov 1, 2018 at 11:40 AM Yifeng Sun <pkusunyifeng@gmail.com> wrote:
> 
> > This patch frees the leaked free string to stop oss-fuzz from
> > complaining.
> >
> > Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11161
> > Signed-off-by
> > <https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11161Signed-off-by>:
> > Yifeng Sun <pkusunyifeng@gmail.com>
> > ---
> >  tests/oss-fuzz/ofctl_parse_target.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/tests/oss-fuzz/ofctl_parse_target.c
> > b/tests/oss-fuzz/ofctl_parse_target.c
> > index 13d0899dbbae..8a906400a5cc 100644
> > --- a/tests/oss-fuzz/ofctl_parse_target.c
> > +++ b/tests/oss-fuzz/ofctl_parse_target.c
> > @@ -58,6 +58,7 @@ ofctl_parse_flow(const char *input, int command)
> >                                     command, &usable_protocols);
> >      if (error) {
> >          printf("Error encountered: %s\n", error);
> > +        free(error);
> >      } else {
> >          ofctl_parse_flows__(&fm, 1, usable_protocols);
> >      }
> > --
> > 2.7.4
> >
> >
diff mbox series

Patch

diff --git a/tests/oss-fuzz/ofctl_parse_target.c b/tests/oss-fuzz/ofctl_parse_target.c
index 13d0899dbbae..8a906400a5cc 100644
--- a/tests/oss-fuzz/ofctl_parse_target.c
+++ b/tests/oss-fuzz/ofctl_parse_target.c
@@ -58,6 +58,7 @@  ofctl_parse_flow(const char *input, int command)
                                    command, &usable_protocols);
     if (error) {
         printf("Error encountered: %s\n", error);
+        free(error);
     } else {
         ofctl_parse_flows__(&fm, 1, usable_protocols);
     }