[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt PATCH 18/21] tests: Use glib memory functions in pci_driver_new



Signed-off-by: Tim Wiederhake <twiederh redhat com>
---
 tests/virpcimock.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index c8aa8f3f01..787172d24c 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -701,12 +701,12 @@ pci_driver_new(const char *name, ...)
         if ((device = va_arg(args, int)) == -1)
             ABORT("Invalid vendor device pair for driver %s", name);
 
-        if (VIR_REALLOC_N_QUIET(driver->vendor, driver->len + 1) < 0 ||
-            VIR_REALLOC_N_QUIET(driver->device, driver->len + 1) < 0)
-            ABORT_OOM();
-
+        driver->vendor = g_renew(int, driver->vendor, driver->len + 1);
         driver->vendor[driver->len] = vendor;
+
+        driver->device = g_renew(int, driver->device, driver->len + 1);
         driver->device[driver->len] = device;
+
         driver->len++;
     }
 
-- 
2.26.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]