if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_open_uri(&handle,uri,GNOME_VFS_OPEN_READ)))
goto fail;
+ CAPTIVE_MEMZERO(&file_info_local);
if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_get_file_info_from_handle(handle,&file_info_local,GNOME_VFS_FILE_INFO_DEFAULT)))
goto fail_close_handle;
if (file_info_local.type!=GNOME_VFS_FILE_TYPE_REGULAR) {
errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT;
- goto fail_close_handle;
+ goto fail_file_info_local_clear;
}
if (!(file_info_local.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE)) {
errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT;
- goto fail_close_handle;
+ goto fail_file_info_local_clear;
}
if (!captivemodid_module_length_is_valid(file_info_local.size)) {
errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT;
- goto fail_close_handle;
+ goto fail_file_info_local_clear;
}
if (file_info_local.size<=MAX_FILE_LOAD_LENGTH)
mod_uri_load_file_handle_to_memory(handle,&file_info_local,uri);
}
errvfsresult=GNOME_VFS_OK;
/* PASSTHRU */
+fail_file_info_local_clear:
+ gnome_vfs_file_info_clear(&file_info_local);
fail_close_handle:
gnome_vfs_close(handle);
fail:;
g_free(uri_text);
}
+ CAPTIVE_MEMZERO(&file_info_local);
file_info_local.type=GNOME_VFS_FILE_TYPE_UNKNOWN;
if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_get_file_info_uri(uri,&file_info_local,GNOME_VFS_FILE_INFO_DEFAULT))) {
if (base_reporting) {
return;
}
switch (file_info_local.type) {
- case GNOME_VFS_FILE_TYPE_REGULAR: return mod_uri_load_file(uri);
- case GNOME_VFS_FILE_TYPE_DIRECTORY: return mod_uri_load_directory(uri);
- default: return /* GNOME_VFS_ERROR_WRONG_FORMAT */;
+ case GNOME_VFS_FILE_TYPE_REGULAR: mod_uri_load_file(uri);
+ case GNOME_VFS_FILE_TYPE_DIRECTORY: mod_uri_load_directory(uri);
+ default: /* GNOME_VFS_ERROR_WRONG_FORMAT */;
}
- /* NOTREACHED */
+ gnome_vfs_file_info_clear(&file_info_local);
}
void mod_uri_load(GnomeVFSURI *uri)