virpcimock: Initialize real_close before using it

real_close() is not inialized by the first invocation of close(). That
causes an issue when the mock is used before others and a call of
real_close() results in a jump to NULL pointer.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Roman Bolshakov 2020-11-03 17:26:28 +03:00 committed by Andrea Bolognani
parent 457877eae4
commit 31eb96358f

View File

@ -1123,6 +1123,8 @@ opendir(const char *path)
int
close(int fd)
{
init_syms();
if (remove_fd(fd) < 0)
return -1;
return real_close(fd);