Message ID | 20170421100404.16350-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 2017-04-21 03:04 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > This fixes a static analysis warning. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/opal/prd_info.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/opal/prd_info.c b/src/opal/prd_info.c > index 04e0f4aa..bbaac408 100644 > --- a/src/opal/prd_info.c > +++ b/src/opal/prd_info.c > @@ -80,8 +80,10 @@ static int prd_service_check(fwts_framework *fw, int *restart) > command = "systemctl status opal-prd.service 2>&1"; > status = fwts_exec2(command, &output); > > - if (output) > + if (output) { > free(output); > + output = NULL; > + } > > switch (status) { > case -1: /* status when nothing was successful */ > Acked-by: Alex Hung <alex.hung@canonical.com>
On 04/21/2017 06:04 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > This fixes a static analysis warning. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/opal/prd_info.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/opal/prd_info.c b/src/opal/prd_info.c > index 04e0f4aa..bbaac408 100644 > --- a/src/opal/prd_info.c > +++ b/src/opal/prd_info.c > @@ -80,8 +80,10 @@ static int prd_service_check(fwts_framework *fw, int *restart) > command = "systemctl status opal-prd.service 2>&1"; > status = fwts_exec2(command, &output); > > - if (output) > + if (output) { > free(output); > + output = NULL; > + } > > switch (status) { > case -1: /* status when nothing was successful */ > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/opal/prd_info.c b/src/opal/prd_info.c index 04e0f4aa..bbaac408 100644 --- a/src/opal/prd_info.c +++ b/src/opal/prd_info.c @@ -80,8 +80,10 @@ static int prd_service_check(fwts_framework *fw, int *restart) command = "systemctl status opal-prd.service 2>&1"; status = fwts_exec2(command, &output); - if (output) + if (output) { free(output); + output = NULL; + } switch (status) { case -1: /* status when nothing was successful */