HDFS-16667. Use malloc for buffer allocation in uriparser2 (#4576)
* Windows doesn't support variables for specifying the array size. * This PR uses malloc to fix this issue.
This commit is contained in:
parent
e664f81ce7
commit
d07256a96d
|
@ -71,9 +71,11 @@ static const char *copy_path(const UriPathSegmentA *ps, char **buffer) {
|
|||
static int parse_int(const char *first, const char *after_last) {
|
||||
const int size = after_last - first;
|
||||
if (size) {
|
||||
char buffer[size + 1];
|
||||
char* buffer = (char*) malloc(size + 1);
|
||||
memcpyz(buffer, first, size);
|
||||
return atoi(buffer);
|
||||
const int value = atoi(buffer);
|
||||
free(buffer);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue