mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Fix memory leaks from errors while reading strings or numbers
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user