From 63f582e0f5ad0fe006d712e1f680e0be9c532d21 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 18 Feb 2019 20:29:19 +0000 Subject: [PATCH] loader: ptable_close() should check its argument If the passed in table is NULL, just return. --- stand/common/part.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stand/common/part.c b/stand/common/part.c index a1fa5e69fde7..672389dad3aa 100644 --- a/stand/common/part.c +++ b/stand/common/part.c @@ -788,6 +788,9 @@ ptable_close(struct ptable *table) { struct pentry *entry; + if (table == NULL) + return; + while (!STAILQ_EMPTY(&table->entries)) { entry = STAILQ_FIRST(&table->entries); STAILQ_REMOVE_HEAD(&table->entries, entry);