Avoid a memory leak by using reallocf() instead of realloc().
This commit is contained in:
parent
73e8989de8
commit
098b8611cb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109040
@ -222,7 +222,7 @@ getcwd(pt, size)
|
||||
}
|
||||
off = bpt - pt;
|
||||
len = ept - bpt;
|
||||
if ((pt = realloc(pt, ptsize *= 2)) == NULL)
|
||||
if ((pt = reallocf(pt, ptsize *= 2)) == NULL)
|
||||
goto err;
|
||||
bpt = pt + off;
|
||||
ept = pt + ptsize;
|
||||
|
Loading…
Reference in New Issue
Block a user