mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
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:
parent
457877eae4
commit
31eb96358f
@ -1123,6 +1123,8 @@ opendir(const char *path)
|
|||||||
int
|
int
|
||||||
close(int fd)
|
close(int fd)
|
||||||
{
|
{
|
||||||
|
init_syms();
|
||||||
|
|
||||||
if (remove_fd(fd) < 0)
|
if (remove_fd(fd) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return real_close(fd);
|
return real_close(fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user