xenforeignmemory: fix fd leakage in error path
PATCH 1/1 xenforeignmemory: fix fd leakage in error path
b49ef5d3 (xenforeignmemory: work around bug in older privcmd) added an error path but forgot to close fd there.
Reported-by Andrew Cooper <[email protected]>
Signed-off-by Wei Liu <[email protected]>
---
Cc: Ian Jackson <[email protected]>
--- tools/libs/foreignmemory/linux.c | 1 + 1 file changed, 1 insertion(+)
tools/libs/foreignmemory/linux.c +1 -0
@@ -62,6 +62,7 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem) {xtl_log (fmem->logger,XTL_ERROR ,-1 ,"xenforeignmemory" ,"privcmd ioctl should not be implemented" ); +close (fd);return -1 ; } else
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 2 lines · Wei Liu
b49ef5d3(xenforeignmemory: work around bug in older privcmd) added an error path but forgot to close fd there.
Spotted by Coverity.
Quoted 3 lines
Reported-by Andrew Cooper <[email protected]>Signed-off-by Wei Liu <[email protected]>
Reviewed-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel