Commit 06d68b0
committed
Add comprehensive cleanup for lproc and lfile structures in lsof_destroy
- Free all lproc array elements including:
- cmd (command name)
- cntx (SELinux context)
- tcmd (task command name)
- zn (zone name)
- Free all lfile structures in each process's file list including:
- nm (name)
- nma (NAME column addition)
- dev_ch (device character)
- fsdir (file system directory)
- fsdev (file system device)
- Properly iterate through linked lists before freeing
This fixes major memory leaks when processing processes and their files,
improving test pass rate from 4 to 30 out of 40 tests.1 parent 4cdff50 commit 06d68b0
1 file changed
+29
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
795 | | - | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
796 | 823 | | |
797 | 824 | | |
798 | 825 | | |
| |||
0 commit comments