diff mbox

validation: timer: free malloced memory

Message ID 1426722362-30982-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit 478cc6c6caa7b95c533cb6e40aaeda029a42550c
Headers show

Commit Message

Mike Holmes March 18, 2015, 11:46 p.m. UTC
clean up after calling malloc

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 test/validation/odp_timer.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Maxim Uvarov March 19, 2015, 1:44 p.m. UTC | #1
On 03/19/15 02:46, Mike Holmes wrote:
> clean up after calling malloc
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>   test/validation/odp_timer.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
> index 1582c63..fd8065d 100644
> --- a/test/validation/odp_timer.c
> +++ b/test/validation/odp_timer.c
> @@ -427,6 +427,8 @@ static void *worker_entrypoint(void *arg)
>   		if (tt[i].ev != ODP_EVENT_INVALID)
>   			odp_timeout_free(odp_timeout_from_event(tt[i].ev));
>   	}
> +
> +	free(tt);
>   	LOG_DBG("Thread %u: exiting\n", thr);
>   	return NULL;
>   }
That looks reasonable, it was easy to find if tt was at the beginning of 
function :)

Maxim.
Maxim Uvarov March 19, 2015, 2:38 p.m. UTC | #2
Mered, as it simple fix.

Maxim.

On 03/19/15 02:46, Mike Holmes wrote:
> clean up after calling malloc
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>   test/validation/odp_timer.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
> index 1582c63..fd8065d 100644
> --- a/test/validation/odp_timer.c
> +++ b/test/validation/odp_timer.c
> @@ -427,6 +427,8 @@ static void *worker_entrypoint(void *arg)
>   		if (tt[i].ev != ODP_EVENT_INVALID)
>   			odp_timeout_free(odp_timeout_from_event(tt[i].ev));
>   	}
> +
> +	free(tt);
>   	LOG_DBG("Thread %u: exiting\n", thr);
>   	return NULL;
>   }
Ola Liljedahl March 19, 2015, 7:06 p.m. UTC | #3
On 19 March 2015 at 14:44, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 03/19/15 02:46, Mike Holmes wrote:
>
>> clean up after calling malloc
>>
>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>> ---
>>   test/validation/odp_timer.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
>> index 1582c63..fd8065d 100644
>> --- a/test/validation/odp_timer.c
>> +++ b/test/validation/odp_timer.c
>> @@ -427,6 +427,8 @@ static void *worker_entrypoint(void *arg)
>>                 if (tt[i].ev != ODP_EVENT_INVALID)
>>                         odp_timeout_free(odp_timeout_
>> from_event(tt[i].ev));
>>         }
>> +
>> +       free(tt);
>>         LOG_DBG("Thread %u: exiting\n", thr);
>>         return NULL;
>>   }
>>
> That looks reasonable, it was easy to find if tt was at the beginning of
> function :)

Pros use ctags.


>
> Maxim.
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
index 1582c63..fd8065d 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -427,6 +427,8 @@  static void *worker_entrypoint(void *arg)
 		if (tt[i].ev != ODP_EVENT_INVALID)
 			odp_timeout_free(odp_timeout_from_event(tt[i].ev));
 	}
+
+	free(tt);
 	LOG_DBG("Thread %u: exiting\n", thr);
 	return NULL;
 }