From f3bfebb0b4bc75eb73a57b87e83057a516787aa6 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Fri, 11 Sep 2020 13:42:14 +0200 Subject: [PATCH] tests: Use glib memory functions in add_fd MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim Wiederhake Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- 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.47.2