mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-02 01:08:14 +00:00
Fix memory leaks from errors while reading strings or numbers
This commit is contained in:
parent
391db023e0
commit
c6077f7e54
@ -404,6 +404,7 @@ again:
|
|||||||
c = j->peek(j);
|
c = j->peek(j);
|
||||||
if (c < '0' || c > '9') {
|
if (c < '0' || c > '9') {
|
||||||
j->error = "Exponent without digits";
|
j->error = "Exponent without digits";
|
||||||
|
free(val.buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
while (c >= '0' && c <= '9') {
|
while (c >= '0' && c <= '9') {
|
||||||
@ -467,6 +468,7 @@ again:
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
j->error = "Found backslash followed by unknown character";
|
j->error = "Found backslash followed by unknown character";
|
||||||
|
free(val.buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user