From 86e9d85f21a6bd52a25241136028ce390060d6c9 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 17 Mar 2018 10:42:51 +0300 Subject: [PATCH] (extfs_done): fix possible NULL dereference. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index aa69b9db0..b58a18db9 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -1687,6 +1687,9 @@ extfs_done (struct vfs_class *me) ar = first_archive; } + if (extfs_plugins == NULL) + return; + for (i = 0; i < extfs_plugins->len; i++) { extfs_plugin_info_t *info; @@ -1696,8 +1699,7 @@ extfs_done (struct vfs_class *me) g_free (info->prefix); } - if (extfs_plugins != NULL) - g_array_free (extfs_plugins, TRUE); + g_array_free (extfs_plugins, TRUE); } /* --------------------------------------------------------------------------------------------- */