Commit 7156a20b authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

lcDB.c: ensure buffer size is updated correctly if realloc fails

parent 0574a55e
......@@ -210,11 +210,12 @@ realloc_parse_info(
int len)
{
char *p;
int newsize = BUFSIZE * ((parse_info.bufsize + len)/BUFSIZE + 1);
parse_info.bufMaxSize = BUFSIZE * ((parse_info.bufsize + len)/BUFSIZE + 1);
p = (char *)Xrealloc(parse_info.buf, parse_info.bufMaxSize);
p = Xrealloc(parse_info.buf, newsize);
if (p == NULL)
return False;
parse_info.bufMaxSize = newsize;
parse_info.buf = p;
return True;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment