ACK: [PATCH] opal: prd_info: NULLify output after free
Alex Hung
alex.hung at canonical.com
Sat Apr 22 15:00:55 UTC 2017
On 2017-04-21 03:04 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> This fixes a static analysis warning.
>
> Signed-off-by: Colin Ian King <colin.king at 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 at canonical.com>
More information about the fwts-devel
mailing list