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:
Siddhesh Poyarekar 2021-08-03 21:11:03 +05:30
parent 45caed9d67
commit 77a34079d8

View File

@ -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. */