#vulnerable code 
                                private static CFLintConfig loadConfig(final String configfile) {
        if (configfile != null) {
            try {
                CFLintPluginInfo pluginInfo=null;
                if (configfile.toLowerCase().endsWith(".xml")) {
                    final Object configObj = ConfigUtils.unmarshal(new FileInputStream(configfile));
                    if (configObj instanceof CFLintPluginInfo)
                        pluginInfo= (CFLintPluginInfo) configObj;
                    else if(configObj instanceof CFLintConfig ){
                        return (CFLintConfig) configObj;
                    }
                } else {
                    return ConfigUtils.unmarshalJson(new FileInputStream(configfile), CFLintConfig.class);
                }
                CFLintConfig returnVal = new CFLintConfig();
                returnVal.setRules(pluginInfo.getRules());
                return returnVal;
            } catch (final Exception e) {
                System.err.println("Unable to load config file. " + e.getMessage());
            }
        }
        return null;
    } 
                            #location 16 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                private static CFLintConfig loadConfig(final String configfile) {
        if (configfile != null) {
            try {
                CFLintPluginInfo pluginInfo = null;
                if (configfile.toLowerCase().endsWith(".xml")) {
                    final Object configObj = ConfigUtils.unmarshal(new FileInputStream(configfile));
                    if (configObj instanceof CFLintPluginInfo)
                        pluginInfo = (CFLintPluginInfo) configObj;
                    else if(configObj instanceof CFLintConfig ){
                        return (CFLintConfig) configObj;
                    }
                } else {
                    return ConfigUtils.unmarshalJson(new FileInputStream(configfile), CFLintConfig.class);
                }
                CFLintConfig returnVal = new CFLintConfig();
                if (pluginInfo != null)
                    returnVal.setRules(pluginInfo.getRules());
                return returnVal;
            } catch (final Exception e) {
                System.err.println("Unable to load config file. " + e.getMessage());
            }
        }
        return null;
    }