--- HACKING | 20 +++++--------------- docs/hacking.html.in | 20 +++++--------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/HACKING b/HACKING index a310faa..26dc0d0 100644 --- a/HACKING +++ b/HACKING @@ -535,10 +535,8 @@ routines, use the macros from viralloc.h. virDomainPtr domain; - if (VIR_ALLOC(domain) < 0) { - virReportOOMError(); + if (VIR_ALLOC(domain) < 0) return NULL; - } @@ -547,10 +545,8 @@ routines, use the macros from viralloc.h. virDomainPtr domains; size_t ndomains = 10; - if (VIR_ALLOC_N(domains, ndomains) < 0) { - virReportOOMError(); + if (VIR_ALLOC_N(domains, ndomains) < 0) return NULL; - } @@ -559,10 +555,8 @@ routines, use the macros from viralloc.h. virDomainPtr *domains; size_t ndomains = 10; - if (VIR_ALLOC_N(domains, ndomains) < 0) { - virReportOOMError(); + if (VIR_ALLOC_N(domains, ndomains) < 0) return NULL; - } @@ -573,10 +567,8 @@ recommended only for smaller arrays): virDomainPtr domains; size_t ndomains = 0; - if (VIR_EXPAND_N(domains, ndomains, 1) < 0) { - virReportOOMError(); + if (VIR_EXPAND_N(domains, ndomains, 1) < 0) return NULL; - } domains[ndomains - 1] = domain; @@ -588,10 +580,8 @@ scales better, but requires tracking allocation separately from usage) size_t ndomains = 0; size_t ndomains_max = 0; - if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) < 0) { - virReportOOMError(); + if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) < 0) return NULL; - } domains[ndomains++] = domain; diff --git a/docs/hacking.html.in b/docs/hacking.html.in index 904b846..b266533 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -661,10 +661,8 @@ <pre> virDomainPtr domain; - if (VIR_ALLOC(domain) < 0) { - virReportOOMError(); + if (VIR_ALLOC(domain) < 0) return NULL; - } </pre> </li> @@ -673,10 +671,8 @@ virDomainPtr domains; size_t ndomains = 10; - if (VIR_ALLOC_N(domains, ndomains) < 0) { - virReportOOMError(); + if (VIR_ALLOC_N(domains, ndomains) < 0) return NULL; - } </pre> </li> @@ -685,10 +681,8 @@ virDomainPtr *domains; size_t ndomains = 10; - if (VIR_ALLOC_N(domains, ndomains) < 0) { - virReportOOMError(); + if (VIR_ALLOC_N(domains, ndomains) < 0) return NULL; - } </pre> </li> @@ -700,10 +694,8 @@ virDomainPtr domains; size_t ndomains = 0; - if (VIR_EXPAND_N(domains, ndomains, 1) < 0) { - virReportOOMError(); + if (VIR_EXPAND_N(domains, ndomains, 1) < 0) return NULL; - } domains[ndomains - 1] = domain; </pre></li> @@ -716,10 +708,8 @@ size_t ndomains = 0; size_t ndomains_max = 0; - if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) < 0) { - virReportOOMError(); + if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) < 0) return NULL; - } domains[ndomains++] = domain; </pre> </li> -- 1.8.1.5 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list