mirror of https://github.com/xemu-project/xemu.git
ppc/spapr_nvdimm: use g_autofree in spapr_nvdimm_validate_opts()
Since we're using the string just once, just use g_autofree and avoid leaking it without calling g_free(). Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <20200825215749.213536-2-danielhb413@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
eab0a2d06e
commit
90d282d085
|
@ -33,7 +33,7 @@
|
||||||
void spapr_nvdimm_validate_opts(NVDIMMDevice *nvdimm, uint64_t size,
|
void spapr_nvdimm_validate_opts(NVDIMMDevice *nvdimm, uint64_t size,
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
char *uuidstr = NULL;
|
g_autofree char *uuidstr = NULL;
|
||||||
QemuUUID uuid;
|
QemuUUID uuid;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ void spapr_nvdimm_validate_opts(NVDIMMDevice *nvdimm, uint64_t size,
|
||||||
&error_abort);
|
&error_abort);
|
||||||
ret = qemu_uuid_parse(uuidstr, &uuid);
|
ret = qemu_uuid_parse(uuidstr, &uuid);
|
||||||
g_assert(!ret);
|
g_assert(!ret);
|
||||||
g_free(uuidstr);
|
|
||||||
|
|
||||||
if (qemu_uuid_is_null(&uuid)) {
|
if (qemu_uuid_is_null(&uuid)) {
|
||||||
error_setg(errp, "NVDIMM device requires the uuid to be set");
|
error_setg(errp, "NVDIMM device requires the uuid to be set");
|
||||||
|
|
Loading…
Reference in New Issue