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

[libvirt PATCH 17/21] tests: Use glib memory functions in add_fd



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

diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index 6b1f2f2a5a..c8aa8f3f01 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -305,11 +305,7 @@ add_fd(int fd, const char *path)
               fd, path, cb.fd, cb.path);
     }
 
-    if (VIR_REALLOC_N_QUIET(callbacks, nCallbacks + 1) < 0) {
-        errno = ENOMEM;
-        return -1;
-    }
-
+    callbacks = g_renew(struct fdCallback, callbacks, nCallbacks + 1);
     callbacks[nCallbacks].path = g_strdup(path);
     callbacks[nCallbacks++].fd = fd;
 
-- 
2.26.2


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