Patchwork acpi: s4: free quirks

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

Comments

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

Coverity CID #997263: Resource leak

Need to free quirks after use.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/s4/s4.c | 1 +
 1 file changed, 1 insertion(+)
Alex Hung - May 10, 2013, 1:21 a.m.
On 05/07/2013 05:54 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Coverity CID #997263: Resource leak
>
> Need to free quirks after use.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/s4/s4.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c
> index 59ffcaf..9f07bcf 100644
> --- a/src/acpi/s4/s4.c
> +++ b/src/acpi/s4/s4.c
> @@ -131,6 +131,7 @@ static int s4_hibernate(fwts_framework *fw,
>   			free(quirks);
>   			return FWTS_OUT_OF_MEMORY;
>   		}
> +		free(quirks);
>   	}
>
>   	fwts_wakealarm_trigger(fw, s4_sleep_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:54 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Coverity CID #997263: Resource leak
>
> Need to free quirks after use.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/s4/s4.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c
> index 59ffcaf..9f07bcf 100644
> --- a/src/acpi/s4/s4.c
> +++ b/src/acpi/s4/s4.c
> @@ -131,6 +131,7 @@ static int s4_hibernate(fwts_framework *fw,
>                         free(quirks);
>                         return FWTS_OUT_OF_MEMORY;
>                 }
> +               free(quirks);
>         }
>
>         fwts_wakealarm_trigger(fw, s4_sleep_delay);
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>>

Patch

diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c
index 59ffcaf..9f07bcf 100644
--- a/src/acpi/s4/s4.c
+++ b/src/acpi/s4/s4.c
@@ -131,6 +131,7 @@  static int s4_hibernate(fwts_framework *fw,
 			free(quirks);
 			return FWTS_OUT_OF_MEMORY;
 		}
+		free(quirks);
 	}
 
 	fwts_wakealarm_trigger(fw, s4_sleep_delay);