summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-02-02 13:20:52 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-02-02 13:20:52 -0800
commit3f1611b69f6b24184aa4b07c796526f49fa0db5f (patch)
treead7ea77404804416bffb4a3037caf997fb50b6cb
parent5f0f8c00f47e778c59ae22bf685c97756456b2cd (diff)
Make sure windowPath is properly initialized & freed
-rw-r--r--dpylist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dpylist.c b/dpylist.c
index 9490ef9..6aca2ee 100644
--- a/dpylist.c
+++ b/dpylist.c
@@ -172,6 +172,7 @@ RemoveDisplay (struct display *old)
IfFree (d->from);
XdmcpDisposeARRAY8 (&d->clientAddr);
#endif
+ IfFree (d->windowPath);
free ((char *) d);
break;
}
@@ -184,7 +185,7 @@ NewDisplay (char *name, char *class)
{
struct display *d;
- d = (struct display *) malloc (sizeof (struct display));
+ d = (struct display *) calloc (1, sizeof (struct display));
if (!d) {
LogOutOfMem ("NewDisplay");
return NULL;
@@ -261,6 +262,9 @@ NewDisplay (char *name, char *class)
d->xdmcpFd = -1;
#endif
d->version = 1; /* registered with The Open Group */
+ d->willing = NULL;
+ d->dpy = NULL;
+ d->windowPath = NULL;
displays = d;
return d;
}