struct dirent **namelist; int file_num;  if ( rsc_info == NULL ) { cl_log(LOG_ERR, "Parameter error: get_resource_list"); return -2; }  if ( *rsc_info != NULL ) { cl_log(LOG_ERR, "Parameter error: get_resource_list."\ "will cause memory leak."); *rsc_info = NULL; }  file_num = scandir(RA_PATH, &namelist, 0, alphasort); if (file_num < 0) { cl_log(LOG_ERR, "scandir failed in OCF RA plugin"); return -2; } else { while (file_num--) { rsc_info_t * rsc_info_tmp = NULL; char tmp_buffer[FILENAME_MAX+1];  tmp_buffer[0] = '\0'; tmp_buffer[FILENAME_MAX] = '\0'; strncpy(tmp_buffer, RA_PATH, FILENAME_MAX); strncat(tmp_buffer, namelist[file_num]->d_name, FILENAME_MAX); if ( filtered(tmp_buffer) == TRUE ) { rsc_info_tmp = g_new(rsc_info_t, 1); rsc_info_tmp->rsc_type = g_strdup(namelist[file_num]->d_name); /* * Since the version definition isn't cleat yet, * the version is setted 1.0. */ rsc_info_tmp->version = g_strdup("1.0"); *rsc_info = g_list_append(*rsc_info, (gpointer)rsc_info_tmp); } free(namelist[file_num]); } free(namelist); } return g_list_length(*rsc_info); 
return get_ra_list(RA_PATH, rsc_info); 
get_resource_list(GList ** rsc_info){	struct dirent **namelist;	int file_num;	if ( rsc_info == NULL ) {		cl_log(LOG_ERR, "Parameter error: get_resource_list");		return -2;	}	if ( *rsc_info != NULL ) {		cl_log(LOG_ERR, "Parameter error: get_resource_list."\			"will cause memory leak.");		*rsc_info = NULL;	} 	file_num = scandir(RA_PATH, &namelist, 0, alphasort);	if (file_num < 0) {		cl_log(LOG_ERR, "scandir failed in OCF RA plugin");		return -2;	} else 	{		while (file_num--) {			rsc_info_t * rsc_info_tmp = NULL;			char tmp_buffer[FILENAME_MAX+1];			tmp_buffer[0] = '\0';			tmp_buffer[FILENAME_MAX] = '\0';			strncpy(tmp_buffer, RA_PATH, FILENAME_MAX);			strncat(tmp_buffer, namelist[file_num]->d_name, FILENAME_MAX);			if ( filtered(tmp_buffer) == TRUE ) {				rsc_info_tmp = g_new(rsc_info_t, 1);					rsc_info_tmp->rsc_type = 					g_strdup(namelist[file_num]->d_name);			/* 			 * Since the version definition isn't cleat yet,			 * the version is setted 1.0.			 */				rsc_info_tmp->version = g_strdup("1.0");				*rsc_info = g_list_append(*rsc_info, 						(gpointer)rsc_info_tmp);			}			free(namelist[file_num]);		}		free(namelist);	}	return g_list_length(*rsc_info);			}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/737f2f2506cf438b227483a7dd489b86dfb3f297/raexechb.c/buggy/lib/plugins/lrm/raexechb.c