Fix a possible memory leak in dtoa

Fix GH-15061
This commit is contained in:
Nobuyoshi Nakada 2025-12-24 11:30:11 +09:00 committed by Nobuyoshi Nakada
parent 6af9b8d59a
commit 44693ee329
Notes: git 2025-12-24 05:06:13 +00:00

View File

@ -547,10 +547,13 @@ Balloc(int k)
}
static void
Bfree(Bigint *v)
Bclear(Bigint **vp)
{
FREE(v);
Bigint *v = *vp;
*vp = NULL;
if (v) FREE(v);
}
#define Bfree(v) Bclear(&(v))
#define Bcopy(x,y) memcpy((char *)&(x)->sign, (char *)&(y)->sign, \
(y)->wds*sizeof(Long) + 2*sizeof(int))