[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 01/21] migration-test: Use g_free() instead of free()
From: |
Juan Quintela |
Subject: |
Re: [PATCH v3 01/21] migration-test: Use g_free() instead of free() |
Date: |
Fri, 24 Jan 2020 12:08:26 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Daniel P. Berrangé <address@hidden> wrote:
> On Thu, Jan 23, 2020 at 12:58:11PM +0100, Juan Quintela wrote:
>> Signed-off-by: Juan Quintela <address@hidden>
>> ---
>> tests/qtest/migration-test.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
>> index 26e2e77289..b6a74a05ce 100644
>> --- a/tests/qtest/migration-test.c
>> +++ b/tests/qtest/migration-test.c
>> @@ -1291,7 +1291,7 @@ static void test_multifd_tcp(void)
>> wait_for_serial("dest_serial");
>> wait_for_migration_complete(from);
>> test_migrate_end(from, to, true);
>> - free(uri);
>> + g_free(uri);
>
> Not an objection to this patch, just a general FYI.
>
> Our min glib guarantees that g_malloc/g_free are always using the
> system allocator. So using free() is not a correctness problem
> these days.
Ok. But the rest of the file uses g_malloc/g_free and friends O:-)
> In general I'd suggest eliminating both free() and g_free(), and instead
> annotating the variable decl for automatic free. eg
>
> g_autofree char *uri = NULL;
I will investigate this, thanks.
Later, Juan.
- [PATCH v3 00/21] Multifd Migration Compression, Juan Quintela, 2020/01/23
- [PATCH v3 01/21] migration-test: Use g_free() instead of free(), Juan Quintela, 2020/01/23
- [PATCH v3 02/21] multifd: Make sure that we don't do any IO after an error, Juan Quintela, 2020/01/23
- [PATCH v3 03/21] qemu-file: Don't do IO after shutdown, Juan Quintela, 2020/01/23
- [PATCH v3 04/21] migration-test: Make sure that multifd and cancel works, Juan Quintela, 2020/01/23
- [PATCH v3 05/21] migration: Create migration_is_running(), Juan Quintela, 2020/01/23
- [PATCH v3 06/21] migration: Don't send data if we have stopped, Juan Quintela, 2020/01/23
- [PATCH v3 07/21] migration: Make multifd_save_setup() get an Error parameter, Juan Quintela, 2020/01/23
- [PATCH v3 08/21] migration: Make multifd_load_setup() get an Error parameter, Juan Quintela, 2020/01/23