mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 11:43:34 +08:00
gaiconf_init: Avoid double-free in label and precedence lists
labellist and precedencelist could get freed a second time if there are allocation failures, so set them to NULL to avoid a double-free. Reviewed-by: Arjun Shankar <arjun@redhat.com>
This commit is contained in:
parent
45caed9d67
commit
77a34079d8
@ -2008,6 +2008,7 @@ gaiconf_init (void)
|
||||
l = l->next;
|
||||
}
|
||||
free_prefixlist (labellist);
|
||||
labellist = NULL;
|
||||
|
||||
/* Sort the entries so that the most specific ones are at
|
||||
the beginning. */
|
||||
@ -2046,6 +2047,7 @@ gaiconf_init (void)
|
||||
l = l->next;
|
||||
}
|
||||
free_prefixlist (precedencelist);
|
||||
precedencelist = NULL;
|
||||
|
||||
/* Sort the entries so that the most specific ones are at
|
||||
the beginning. */
|
||||
|
Loading…
Reference in New Issue
Block a user