ftpfs: Fix NULL pointer access

This commit is contained in:
Sebastian Huber
2012-11-22 14:08:38 +01:00
parent f5d02852ed
commit 82eb2c4d5f

View File

@@ -1148,6 +1148,9 @@ static void rtems_ftpfs_eval_path(
static void rtems_ftpfs_free_node(const rtems_filesystem_location_info_t *loc) static void rtems_ftpfs_free_node(const rtems_filesystem_location_info_t *loc)
{ {
rtems_ftpfs_entry *e = loc->node_access; rtems_ftpfs_entry *e = loc->node_access;
/* The root node handler has no entry */
if (e != NULL) {
const rtems_ftpfs_mount_entry *me = loc->mt_entry->fs_info; const rtems_ftpfs_mount_entry *me = loc->mt_entry->fs_info;
/* Close control connection if necessary */ /* Close control connection if necessary */
@@ -1159,6 +1162,7 @@ static void rtems_ftpfs_free_node(const rtems_filesystem_location_info_t *loc)
free(e); free(e);
} }
}
static rtems_filesystem_node_types_t rtems_ftpfs_node_type( static rtems_filesystem_node_types_t rtems_ftpfs_node_type(
const rtems_filesystem_location_info_t *loc const rtems_filesystem_location_info_t *loc