qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 10/33] job: Add job_delete()


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [RFC PATCH 10/33] job: Add job_delete()
Date: Tue, 24 Apr 2018 17:15:48 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 04/24/2018 10:24 AM, Kevin Wolf wrote:
> This moves freeing the Job object and its fields from block_job_unref()
> to job_delete().
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---

> +++ b/job.c
> @@ -56,3 +56,9 @@ void *job_create(const char *job_id, const JobDriver 
> *driver, Error **errp)
>  
>      return job;
>  }
> +
> +void job_delete(Job *job)
> +{
> +    g_free(job->id);
> +    g_free(job);

Should this be free()-like, by being a no-op when NULL is passed in, on
the grounds that it might simplify some partial-construction error paths?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]