diff options
author | Peter Krempa <pkrempa@redhat.com> | 2021-02-23 17:17:10 +0100 |
---|---|---|
committer | Peter Krempa <pkrempa@redhat.com> | 2021-03-02 09:50:19 +0100 |
commit | 22dbafe092d5c3d66f3ed724f28e3fb3980486b4 (patch) | |
tree | a9900700d4fa3c711d3ff5e63eb5772c65e6fc48 | |
parent | 9339163894207518f5f098723ea7fd12cbc9cfe0 (diff) | |
download | libvirt-22dbafe092d5c3d66f3ed724f28e3fb3980486b4.tar.gz |
virCloseCallbacksGetForConn: Remove OOM handling
VIR_EXPAND_N will abort so we can simplify the hash iterator.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
-rw-r--r-- | src/hypervisor/virclosecallbacks.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/hypervisor/virclosecallbacks.c b/src/hypervisor/virclosecallbacks.c index 2641f45a22..1fd4dd7adf 100644 --- a/src/hypervisor/virclosecallbacks.c +++ b/src/hypervisor/virclosecallbacks.c @@ -241,7 +241,6 @@ struct _virCloseCallbacksList { struct virCloseCallbacksData { virConnectPtr conn; virCloseCallbacksListPtr list; - bool oom; }; static int @@ -263,11 +262,7 @@ virCloseCallbacksGetOne(void *payload, if (data->conn != closeDef->conn || !closeDef->cb) return 0; - if (VIR_EXPAND_N(data->list->entries, - data->list->nentries, 1) < 0) { - data->oom = true; - return 0; - } + ignore_value(VIR_EXPAND_N(data->list->entries, data->list->nentries, 1)); memcpy(data->list->entries[data->list->nentries - 1].uuid, uuid, VIR_UUID_BUFLEN); @@ -286,17 +281,9 @@ virCloseCallbacksGetForConn(virCloseCallbacksPtr closeCallbacks, data.conn = conn; data.list = list; - data.oom = false; virHashForEach(closeCallbacks->list, virCloseCallbacksGetOne, &data); - if (data.oom) { - VIR_FREE(list->entries); - VIR_FREE(list); - virReportOOMError(); - return NULL; - } - return list; } |