x509: Fix leak if there is an empty CDP
This commit is contained in:
parent
5e37f7e550
commit
388351609d
|
@ -818,10 +818,12 @@ static void add_cdps(linked_list_t *list, linked_list_t *uris,
|
|||
enumerator_t *enumerator;
|
||||
x509_cdp_t *cdp;
|
||||
char *uri;
|
||||
int len;
|
||||
|
||||
while (uris->remove_last(uris, (void**)&id) == SUCCESS)
|
||||
{
|
||||
if (asprintf(&uri, "%Y", id) > 0)
|
||||
len = asprintf(&uri, "%Y", id);
|
||||
if (len > 0)
|
||||
{
|
||||
if (issuers->get_count(issuers))
|
||||
{
|
||||
|
@ -845,6 +847,10 @@ static void add_cdps(linked_list_t *list, linked_list_t *uris,
|
|||
list->insert_last(list, cdp);
|
||||
}
|
||||
}
|
||||
else if (!len)
|
||||
{
|
||||
free(uri);
|
||||
}
|
||||
id->destroy(id);
|
||||
}
|
||||
while (issuers->remove_last(issuers, (void**)&id) == SUCCESS)
|
||||
|
|
Loading…
Reference in New Issue