Patchwork acpi: s3: free quirks

login
register
mail settings
Submitter Colin King
Date May 7, 2013, 9:56 a.m.
Message ID <1367920600-20484-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/242094/
State Accepted
Headers show

Comments

Colin King - May 7, 2013, 9:56 a.m.
From: Colin Ian King <colin.king@canonical.com>

Coverity CID #997264, Resource leak.

Need to free quirks

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/s3/s3.c | 1 +
 1 file changed, 1 insertion(+)
Alex Hung - May 10, 2013, 1:22 a.m.
On 05/07/2013 05:56 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Coverity CID #997264, Resource leak.
>
> Need to free quirks
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/s3/s3.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index ae89423..ad1f564 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -99,6 +99,7 @@ static int s3_do_suspend_resume(fwts_framework *fw,
>   			free(quirks);
>   			return FWTS_OUT_OF_MEMORY;
>   		}
> +		free(quirks);
>   	}
>
>   	fwts_wakealarm_trigger(fw, delay);
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - May 20, 2013, 7:42 a.m.
On Tue, May 7, 2013 at 5:56 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Coverity CID #997264, Resource leak.
>
> Need to free quirks
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/s3/s3.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index ae89423..ad1f564 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -99,6 +99,7 @@ static int s3_do_suspend_resume(fwts_framework *fw,
>                         free(quirks);
>                         return FWTS_OUT_OF_MEMORY;
>                 }
> +               free(quirks);
>         }
>
>         fwts_wakealarm_trigger(fw, delay);
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
index ae89423..ad1f564 100644
--- a/src/acpi/s3/s3.c
+++ b/src/acpi/s3/s3.c
@@ -99,6 +99,7 @@  static int s3_do_suspend_resume(fwts_framework *fw,
 			free(quirks);
 			return FWTS_OUT_OF_MEMORY;
 		}
+		free(quirks);
 	}
 
 	fwts_wakealarm_trigger(fw, delay);