1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

tests: Use glib memory functions in add_fd

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>
This commit is contained in:
Tim Wiederhake 2020-09-11 13:42:14 +02:00 committed by Ján Tomko
parent caf5a88e59
commit f3bfebb0b4

View 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;