diff mbox series

[v2,01/10] nvdimm: Plug memory leak in uuid property setter

Message ID 20200505101908.6207-2-armbru@redhat.com
State New
Headers show
Series More miscellaneous error handling fixes | expand

Commit Message

Markus Armbruster May 5, 2020, 10:18 a.m. UTC
nvdimm_set_uuid() leaks memory on qemu_uuid_parse() failure.  Fix
that.

Fixes: 6c5627bb24dcd68c997857a8b671617333b1289f
Cc: Xiao Guangrong <xiaoguangrong.eric@gmail.com>
Cc: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/mem/nvdimm.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Shivaprasad G Bhat May 6, 2020, 2:23 p.m. UTC | #1
On 05/05/2020 03:48 PM, Markus Armbruster wrote:
> nvdimm_set_uuid() leaks memory on qemu_uuid_parse() failure.  Fix
> that.
>
> Fixes: 6c5627bb24dcd68c997857a8b671617333b1289f
> Cc: Xiao Guangrong <xiaoguangrong.eric@gmail.com>
> Cc: Shivaprasad G Bhat <sbhat@linux.ibm.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Thanks for finding and fixing this Markus.

Tested-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>

Reviewed-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>

Regards,
Shivaprasad

> ---
>   hw/mem/nvdimm.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
> index 8e426d24bb..d5752f7bf6 100644
> --- a/hw/mem/nvdimm.c
> +++ b/hw/mem/nvdimm.c
> @@ -97,7 +97,6 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, const char *name,
>       if (qemu_uuid_parse(value, &nvdimm->uuid) != 0) {
>           error_setg(errp, "Property '%s.%s' has invalid value",
>                      object_get_typename(obj), name);
> -        goto out;
>       }
>       g_free(value);
>
diff mbox series

Patch

diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index 8e426d24bb..d5752f7bf6 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -97,7 +97,6 @@  static void nvdimm_set_uuid(Object *obj, Visitor *v, const char *name,
     if (qemu_uuid_parse(value, &nvdimm->uuid) != 0) {
         error_setg(errp, "Property '%s.%s' has invalid value",
                    object_get_typename(obj), name);
-        goto out;
     }
     g_free(value);