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

Tim Wiederhake twiederh at redhat.com
Fri Sep 11 11:42:14 UTC 2020


Signed-off-by: Tim Wiederhake <twiederh at 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




More information about the libvir-list mailing list