System: WindowsXP
IDE: Code::Blocks
Compiler: gcc (GCC) 3.4.4 (mingw special) <- Comes with Code::Blocks

The code:
Code:
LINE_TEXT **settreelist(char *filename)
/*
	Given:	A string.
	Return:	A LINE_TEXT array or NULL on error.
	Task:	The filename is an adf file format and is the current selected file for the main program.
		Run through the file and pull out all the potential times.  The format will be
		HH:MM:SS AAMMMM.  Two examples of this are "00:23:38 GB STL" and "22:14:49 HDIDLH".
	NOTE:	There will be only one space for any Method name that contains four characters, otherwise,
		there is a space between the Agent and Method names.  Also, a return of NULL could mean
		that there is no such file, or that there are no records in the file.
*/
{
	int i, k;
	LINE_TEXT **list;
	TMRI_PARAMREC p;

//	k = getnumrecs(filename);
// The file only has one record in it -- weeding out any possible problems in another source file.
k = 1;
	k *= 2;
	if (k <= 0)
		return NULL;
	list = (LINE_TEXT **) malloc(sizeof(LINE_TEXT *) * (k + 1));
	list[k] = NULL;
debugmessage(mainwnd, "About to loop.");
	for (i = 0; i < k; i++){
 		list[i] = (LINE_TEXT *) malloc(sizeof(LINE_TEXT));
		list[i]->text = (char *) malloc(sizeof(char) * 10);
//		getnrec(filename, &p, i/2);
// Revmoved during the debug -- attempting to narrow down the problem.
p.times[TIME_TIME].hour = 12;
p.times[TIME_TIME].minute = 20;
p.times[TIME_TIME].second = 33;
p.floats[FLOAT_CONCENTRATION] = 1.23; // Force the first if.
p.floats[FLOAT_ALARMSETPOINT] = 0.23;
strcpy(p.agentname, "AK");
strcpy(p.methodname,"KJK");
		sprintf(list[i]->text, "%02i:%02i:%02i", (int) p.times[TIME_TIME].hour, (int) p.times[TIME_TIME].minute, (int) p.times[TIME_TIME].second);
		if (p.floats[FLOAT_CONCENTRATION] >= p.floats[FLOAT_ALARMSETPOINT]){
			if(get_packederrors(p.bytes[BYTE_PACKEDBITS])){
				list[i]->bgcolor = LINE_COLOR_BGTREEALARM_ERROR;
				list[i]->fgcolor = LINE_COLOR_FGTREEALARM_ERROR;
			} else {
				list[i]->bgcolor = LINE_COLOR_BGTREEALARM;
				list[i]->fgcolor = LINE_COLOR_FGTREEALARM;
			}
		} else if (get_packederrors(p.bytes[BYTE_PACKEDBITS])) {
			list[i]->bgcolor = LINE_COLOR_BGTREEERROR;
			list[i]->fgcolor = LINE_COLOR_FGTREEERROR;
		} else {
			list[i]->bgcolor = LINE_COLOR_BGTREEDEFAULT;
			list[i]->fgcolor = LINE_COLOR_FGTREEDEFAULT;
		}
		i++;
debugmessage(mainwnd, "About to malloc first.");
		list[i] = (LINE_TEXT *) malloc(sizeof(LINE_TEXT));
debugmessage(mainwnd, "Done with first, now second malloc");
		list[i]->text = (char *) malloc(sizeof(char) * 10);
debugmessage(mainwnd, "Done with second malloc. -- Never see this one as we crash.");
		sprintf(list[i]->text, " %s%s%s", p.agentname, (strlen(p.methodname) > 3) ? "" : " ",
						  p.methodname);
		list[i]->bgcolor = LINE_COLOR_BGTREEDEFAULT;
		list[i]->fgcolor = LINE_COLOR_FGTREEDEFAULT;
	}
debugmessage(mainwnd, "About to return");
	return list;
}
The location it fails is marked within the debug message, but it is the fourth malloc. This is code that has been working just fine, however, I have had to add in additional support for a new revision of two of the structures -- so it _could_ be somewhere else in the code, however, I have removed _ALL_ references to the new code (as you can see above) and I'm still getting the same thing. I'm a Linux programmer so I don't get how to use Code::Blocks' debugger. . . and it is not like I'm getting a core file (can this be done in WindowsXP?) to examine.

Any help would be greatly appreciated.

Andy