Try free all resources.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18890 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -283,6 +283,16 @@ HandleOP(GetVersionInfo)
|
|||||||
static int
|
static int
|
||||||
HandleOP(GoodBye)
|
HandleOP(GoodBye)
|
||||||
{
|
{
|
||||||
|
struct handle *h = c->handles;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
while (h) {
|
||||||
|
h = h->next;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
logmessage(c, __FILE__, __LINE__, 0, "did not toast all resources: %d", i);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -929,6 +939,19 @@ create_client(int fd, int port, const char *moniker)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
free_client(struct client *c)
|
||||||
|
{
|
||||||
|
while(c->handles)
|
||||||
|
del_handle(&c->handles, c->handles->idx);
|
||||||
|
|
||||||
|
free(c->moniker);
|
||||||
|
krb5_storage_free(c->sock);
|
||||||
|
if (c->logging)
|
||||||
|
krb5_storage_free(c->logging);
|
||||||
|
free(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
handleServer(void *ptr)
|
handleServer(void *ptr)
|
||||||
@@ -957,9 +980,6 @@ handleServer(void *ptr)
|
|||||||
if ((handler->func)(handler->op, c))
|
if ((handler->func)(handler->op, c))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
krb5_storage_free(c->sock);
|
|
||||||
if (c->logging)
|
|
||||||
krb5_storage_free(c->logging);
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1049,6 +1069,8 @@ main(int argc, char **argv)
|
|||||||
/* close(0); */
|
/* close(0); */
|
||||||
|
|
||||||
handleServer(c);
|
handleServer(c);
|
||||||
|
|
||||||
|
free_client(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
krb5_free_context(context);
|
krb5_free_context(context);
|
||||||
|
Reference in New Issue
Block a user