Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/cpu/cpu_ppc64.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index c7860cb1b4..9eaf9c6ae5 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -188,23 +188,19 @@ ppc64ModelFree(ppc64_model *model) static ppc64_model * ppc64ModelCopy(const ppc64_model *model) { - ppc64_model *copy; + g_autoptr(ppc64_model) copy = NULL; if (VIR_ALLOC(copy) < 0) - goto error; + return NULL; copy->name = g_strdup(model->name); if (ppc64DataCopy(©->data, &model->data) < 0) - goto error; + return NULL; copy->vendor = model->vendor; - return copy; - - error: - ppc64ModelFree(copy); - return NULL; + return g_steal_pointer(©); } static ppc64_model * -- 2.26.2