diff options
author | Pavel Hrdina <phrdina@redhat.com> | 2015-09-22 16:10:04 +0200 |
---|---|---|
committer | Pavel Hrdina <phrdina@redhat.com> | 2015-10-05 09:42:44 +0200 |
commit | 0a9385286a7265a9f1fd2321e037681d7247270b (patch) | |
tree | bb10c914e25551e38c4dcf82baf91d8fb62ef8c9 /libvirt-utils.c | |
parent | 1d39dbaf637db03f6e597ed56b96aa065710b4a1 (diff) | |
download | libvirt-python-0a9385286a7265a9f1fd2321e037681d7247270b.tar.gz |
use VIR_PY_DICT_SET_GOTO
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Diffstat (limited to 'libvirt-utils.c')
-rw-r--r-- | libvirt-utils.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/libvirt-utils.c b/libvirt-utils.c index 02a28ac..2bf7519 100644 --- a/libvirt-utils.c +++ b/libvirt-utils.c @@ -267,22 +267,13 @@ getPyVirTypedParameter(const virTypedParameter *params, } key = libvirt_constcharPtrWrap(params[i].field); - if (!key || !val) - goto cleanup; - - if (PyDict_SetItem(info, key, val) < 0) { - Py_DECREF(info); - goto cleanup; - } - Py_DECREF(key); - Py_DECREF(val); + VIR_PY_DICT_SET_GOTO(info, key, val, cleanup); } return info; cleanup: - Py_XDECREF(key); - Py_XDECREF(val); + Py_DECREF(info); return NULL; } |