resource leak in /net/tap.c
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hi,there might be a resource leak in function net_init_tap in /net/tap.c. The version is 5.1.91.
811 fd = monitor_
812 if (fd == -1) {
813 return -1;
814 }
815
816 ret = qemu_try_
817 if (ret < 0) {
818 error_setg_
819 name, fd);
820 return -1;
821 }
822
823 vnet_hdr = tap_probe_
824 if (vnet_hdr < 0) {
825 close(fd);
826 return -1;
827 }
828
829 net_init_
830 script, downscript,
831 vhostfdname, vnet_hdr, fd, &err);
832 if (err) {
833 error_propagate
834 return -1;
835 }
fd should be closed before return in line 820 and line 834, similar to the implementation in line 825.
hi yuanjungong, /wiki.qemu. org/MailingList s) to fix this memleak according to https:/ /wiki.qemu. org/Contribute/ SubmitAPatch.
You can send a patch to qemu-devel mailing list(https:/
Thanks.