]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Use glib memory functions in add_fd
authorTim Wiederhake <twiederh@redhat.com>
Fri, 11 Sep 2020 11:42:14 +0000 (13:42 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 11 Sep 2020 16:19:59 +0000 (18:19 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
tests/virpcimock.c

index 6b1f2f2a5aaa957017424577834f551db2945309..c8aa8f3f018cd7b2be75220566883f4ac2665a26 100644 (file)
@@ -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;