[PATCH v2 0/2] plugins: Freeing allocated values in hash tables.

Mahmoud Mandour posted 2 patches 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210422005043.3569-1-ma.mandourr@gmail.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>
contrib/plugins/hotblocks.c | 3 ++-
contrib/plugins/hotpages.c  | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
[PATCH v2 0/2] plugins: Freeing allocated values in hash tables.
Posted by Mahmoud Mandour 3 years ago
A hash table made using ``g_hash_table_new`` requires manually
freeing any dynamically allocated keys/values. The two patches
in this series fixes this issue in hotblocks and hotpages plugins.

v1 -> v2: Added a freeing function to hotpages instead of freeing
    the sorted list. That's probably better because the sorted list
    is only made on having ``counts != NULL`` and ``counts`` has a next
    pointer so essentially at least 2 elements in the list.

Mahmoud Mandour (2):
  plugins/hotblocks: Properly freed the hash table values
  plugins/hotpages: Properly freed the hash table values

 contrib/plugins/hotblocks.c | 3 ++-
 contrib/plugins/hotpages.c  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.25.1


Re: [PATCH v2 0/2] plugins: Freeing allocated values in hash tables.
Posted by Alex Bennée 3 years ago
Mahmoud Mandour <ma.mandourr@gmail.com> writes:

> A hash table made using ``g_hash_table_new`` requires manually
> freeing any dynamically allocated keys/values. The two patches
> in this series fixes this issue in hotblocks and hotpages plugins.
>
> v1 -> v2: Added a freeing function to hotpages instead of freeing
>     the sorted list. That's probably better because the sorted list
>     is only made on having ``counts != NULL`` and ``counts`` has a next
>     pointer so essentially at least 2 elements in the list.

Queued to plugins/next, thanks.

-- 
Alex Bennée