object: fix potential leak in getters

If the property is not of the requested type, the getters will leak a
QObject.

Backports commit 560f19f162529d691619ac69ed032321c7f5f1fb from qemu
This commit is contained in:
Marc-André Lureau 2018-03-03 17:22:22 -05:00 committed by Lioncash
parent 42bb73fa96
commit c4e0911f95
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1001,7 +1001,7 @@ char *object_property_get_str(struct uc_struct *uc, Object *obj, const char *nam
retval = g_strdup(qstring_get_str(qstring));
}
QDECREF(qstring);
qobject_decref(ret);
return retval;
}