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

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

 



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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux