mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-24 22:10:13 +00:00
resolv: free only initialized items from gai pool
pool_max_size denotes total allocated rows in pool but possibly not yet initialized. it's pool_size that represents number of actually occupied rows hence use it when freeing pool to avoid freeing random addresses. Signed-off-by: Jan Palus <jpalus@fastmail.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
parent
cfb5a97a93
commit
f2aaf18af5
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2001-2023 Free Software Foundation, Inc.
|
||||
Copyright The GNU Toolchain Authors.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -442,7 +443,7 @@ __gai_freemem (void)
|
||||
{
|
||||
size_t row;
|
||||
|
||||
for (row = 0; row < pool_max_size; ++row)
|
||||
for (row = 0; row < pool_size; ++row)
|
||||
free (pool[row]);
|
||||
|
||||
free (pool);
|
||||
|
Loading…
Reference in New Issue
Block a user