Commit f8c85b8
Fix MEMORY_LEAK.EX in delete_all.c
Add list_clear(&l) before returning -1 on error paths to prevent
memory leak of rule list allocated by list_append().
Svace report:
Dynamic memory, referenced by 'newnode->r', is allocated at
delete_all.c:87 by calling function 'list_append' and lost at
delete_all.c:79. (CWE401, CWE404, CWE775)
Co-authored-by: Z.AI GLM-51 parent ec9ab85 commit f8c85b8
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
0 commit comments