nanogui: NULL pointer


Previous by date: 2 Feb 2001 02:42:23 -0000 Re: tpcal and NanoX on Helio, Robert Hartley
Next by date: 2 Feb 2001 02:42:23 -0000 Re: NULL pointer, Gary James
Previous in thread:
Next in thread: 2 Feb 2001 02:42:23 -0000 Re: NULL pointer, Gary James

Subject: NULL pointer
From: Gary James ####@####.####
Date: 2 Feb 2001 02:42:23 -0000
Message-Id: <20010201215406.A830@pc.twcny.rr.com>

This function in srvfunc.c 

void
GrSendClientData(GR_WINDOW_ID wid, GR_WINDOW_ID did, GR_SERIALNO serial,
				GR_LENGTH len, GR_LENGTH thislen, void
*data)
{
	void *p;

	if(!(p = malloc(len))) GsError(GR_ERROR_MALLOC_FAILED, wid);
	memcpy(p, data, thislen);

	GsDeliverClientDataEvent(did, wid, serial, len, thislen, p);
}

probably ought to return after the GsError() function call

void
GrSendClientData(GR_WINDOW_ID wid, GR_WINDOW_ID did, GR_SERIALNO serial,
				GR_LENGTH len, GR_LENGTH thislen, void
*data)
{
	void *p;

	if(!(p = malloc(len))) 
	{
		GsError(GR_ERROR_MALLOC_FAILED, wid);
		return;
	}
	memcpy(p, data, thislen);

	GsDeliverClientDataEvent(did, wid, serial, len, thislen, p);
}




Previous by date: 2 Feb 2001 02:42:23 -0000 Re: tpcal and NanoX on Helio, Robert Hartley
Next by date: 2 Feb 2001 02:42:23 -0000 Re: NULL pointer, Gary James
Previous in thread:
Next in thread: 2 Feb 2001 02:42:23 -0000 Re: NULL pointer, Gary James


Powered by ezmlm-browse 0.20.