[OpenWrt-Devel] [PATCH rpcd v2 6/6] main: exec_self: make clang analyzer happy
Yousong Zhou
yszhou4tech at gmail.com
Tue Oct 22 01:24:15 EDT 2019
On Tue, 22 Oct 2019 at 12:49, Petr Štetiar <ynezz at true.cz> wrote:
>
> Petr Štetiar <ynezz at true.cz> [2019-10-22 06:26:14]:
>
> > Yousong Zhou <yszhou4tech at gmail.com> [2019-10-21 12:59:24]:
> >
> > almost happy:
> >
> > main.c:65:1: warning: Potential leak of memory pointed to by 'args'
> >
> > diff --git a/main.c b/main.c
> > index 12cb4c5c720c..8b11418f1c09 100644
> > --- a/main.c
> > +++ b/main.c
> > @@ -62,6 +62,7 @@ exec_self(int argc, char **argv)
> >
> > setenv("RPC_HANGUP", "1", 1);
> > execv(cmd, (char * const *)args);
> > + free(args);
> > }
Good catch ;)
>
> So I went ahead and I've put some more fixes on top of yours[1] and it's all
> green now[2]. I've only compiled test it, so the question is, if it's still
> going to work :-)
>
> 1. https://gitlab.com/ynezz/openwrt-rpcd/commits/yszhou4tech/memory-issues-fixes
> 2. https://gitlab.com/ynezz/openwrt-rpcd/pipelines/90432330
>
> -- ynezz
Thanks for the review. I added a few comments there.
Since you have got the tools ready, please feel free to take over the
series and make fixup, squashes as you like ;) Meanwhile, please
consider sending updated patches to the mailing list for easier
review.
Regards,
yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list