Commit 173c57f
Fix a possible binary leak in Integer.parse/1
Integer.parse/1 followed this pattern:
defp do_parse(<<char, rest :: binary>>, ...) do
...
# instead of re-using the original binary, we do this
{..., <<char, rest :: binary>>}
end
This causes a new binary to be created instead of `rest` just being a
sub-binary.
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>1 parent 737ac62 commit 173c57f
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
0 commit comments