eal: fix memory leak when saving arguments
Checks
Commit Message
This patch fixes a memleak which was reported in Bugzilla within the
eal_save_args function. This was caused by the function mistakenly
adding -- to the eal args instead of breaking beforehand.
Bugzilla ID: 722
Fixes: 293c53d8b23c ("eal: add telemetry callbacks")
Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
---
lib/eal/common/eal_common_options.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Sep 01, 2021 at 09:38:47AM +0000, Conor Walsh wrote:
> This patch fixes a memleak which was reported in Bugzilla within the
> eal_save_args function. This was caused by the function mistakenly
> adding -- to the eal args instead of breaking beforehand.
>
> Bugzilla ID: 722
> Fixes: 293c53d8b23c ("eal: add telemetry callbacks")
>
> Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
On Wed, Sep 1, 2021 at 11:59 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Wed, Sep 01, 2021 at 09:38:47AM +0000, Conor Walsh wrote:
> > This patch fixes a memleak which was reported in Bugzilla within the
> > eal_save_args function. This was caused by the function mistakenly
> > adding -- to the eal args instead of breaking beforehand.
> >
> > Bugzilla ID: 722
> > Fixes: 293c53d8b23c ("eal: add telemetry callbacks")
> >
> > Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
> > Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> > Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
> > ---
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Applied, thanks.
@@ -229,9 +229,9 @@ eal_save_args(int argc, char **argv)
return -1;
for (i = 0; i < argc; i++) {
- eal_args[i] = strdup(argv[i]);
if (strcmp(argv[i], "--") == 0)
break;
+ eal_args[i] = strdup(argv[i]);
}
eal_args[i++] = NULL; /* always finish with NULL */