Commit 767bfec
committed
Use local variable to stop memory leak.
I've change the urls variable to be a local, instead of manually allocating it all the time.
This is only used locally and was causing a memory leak because FreeUPNPUrls gave the impression it free it.
1. FreeUPNPUrls doesn't free the pointer passed in, that's up to caller.
2. The second if(!urls) produced dead code as we checked the pointer just after allocation.1 parent 79de2ea commit 767bfec
2 files changed
+10
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 124 | + | |
131 | 125 | | |
132 | 126 | | |
133 | | - | |
134 | | - | |
135 | 127 | | |
136 | 128 | | |
137 | 129 | | |
138 | 130 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 131 | + | |
145 | 132 | | |
146 | 133 | | |
147 | | - | |
| 134 | + | |
148 | 135 | | |
149 | 136 | | |
150 | | - | |
| 137 | + | |
151 | 138 | | |
152 | 139 | | |
153 | 140 | | |
| |||
165 | 152 | | |
166 | 153 | | |
167 | 154 | | |
168 | | - | |
169 | | - | |
| 155 | + | |
| 156 | + | |
170 | 157 | | |
171 | 158 | | |
172 | 159 | | |
173 | 160 | | |
174 | | - | |
| 161 | + | |
175 | 162 | | |
176 | 163 | | |
177 | 164 | | |
178 | 165 | | |
179 | | - | |
| 166 | + | |
180 | 167 | | |
181 | 168 | | |
182 | 169 | | |
| |||
0 commit comments