[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 04/37] qga: free remaining leaking state
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 04/37] qga: free remaining leaking state |
Date: |
Thu, 28 Jul 2016 15:22:00 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 07/28/2016 08:37 AM, address@hidden wrote:
> From: Marc-André Lureau <address@hidden>
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
> qga/guest-agent-command-state.c | 7 +++++++
> qga/guest-agent-core.h | 1 +
> qga/main.c | 6 ++++++
> 3 files changed, 14 insertions(+)
>
> diff --git a/qga/guest-agent-command-state.c b/qga/guest-agent-command-state.c
> index 4de229c..56e63b1 100644
> --- a/qga/guest-agent-command-state.c
> +++ b/qga/guest-agent-command-state.c
> @@ -71,3 +71,10 @@ GACommandState *ga_command_state_new(void)
> cs->groups = NULL;
> return cs;
> }
> +
> +void ga_command_state_free(GACommandState *cs)
> +{
> + g_slist_foreach(cs->groups, (GFunc)g_free, NULL);
Here, the ugly cast is because we don't have a static forwarder function
with the correct signature handy. Hmm, I wonder if it is worth adding a
static inline forwarder function in one of our headers that ALL files
can use, when they want to use a 2-arg callback that merely calls
g_free() on its first argument and ignores the second, since we have now
proved it is a commonly-used forwarder.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 00/37] Various memory leak fixes, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 04/37] qga: free remaining leaking state, marcandre . lureau, 2016/07/28
- Re: [Qemu-devel] [PATCH v2 04/37] qga: free remaining leaking state,
Eric Blake <=
- [Qemu-devel] [PATCH v2 06/37] tests: fix test-vmstate leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 05/37] tests: fix test-cutils leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 07/37] tests: fix test-iov leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 08/37] qdist: fix entries memory leak, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 09/37] tests: fix check-qom-interface leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 10/37] tests: fix check-qom-proplist leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 11/37] tests: fix small leak in test-io-channel-command, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 12/37] tests: fix leak in test-string-input-visitor, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 13/37] portio: keep references on portio, marcandre . lureau, 2016/07/28