[comp.windows.x] bug in uwm/RubberBand.c

dale@boing.UUCP (Dale Luck) (09/23/88)

VERSION:
	X11 release 2

CLIENT MACHINE:
	amiga 2000

CLIENT OPERATING SYSTEM:
	amigados

DISPLAY:
	amiga

SYNOPSIS:
	freeing a memory that was not allocated.

DESCRIPTION:
	If uwm gets a window that has no name, it uses
	"Unnamed Window" for the name. However it then
	tries to free the memory associated with this
	string when in fact the string is local to the
	program and had not been malloced.

REPEAT-BY:
	Run uwm, start a program that has no title, when you
	click down to place the window, uwm will try to
	free memory in it's own program space.

FIX:
diff RubberBand.c.bak RubberBand.c
51a52,53
> char *unnamed_window_name = "Unnamed Window";
> 
111c113
<         name = "Unnamed Window";
---
>         name = unnamed_window_name;
367c369
<       free(name);
---
>       if (name != unnamed_window_name)        free(name);

Dale Luck
amiga!dale
-- 
Dale Luck     Boing, Inc. {cbmvax|oliveb|pyramid}|!amiga!boing!dale
Although I do contract work for Amiga-LosGatos, my opinions probably
don't represent those of Commodore or its management or its engineers,
but I think the world would be a better place if they did.