From: Adam Dickmeiss Date: Thu, 11 Mar 2010 14:44:17 +0000 (+0100) Subject: Fix SEGV: client.database reference X-Git-Tag: v1.4.0~100 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=b028d4b9046a07b56569a82359ced280d5b5d21f;p=pazpar2-moved-to-github.git Fix SEGV: client.database reference Ensure client.database (session_database) is set to NULL when it is no longer associated with a session. If it is NULL, then function client_get_URL will return "NOURL". --- diff --git a/src/client.c b/src/client.c index d337ffe..00e72d2 100644 --- a/src/client.c +++ b/src/client.c @@ -805,6 +805,7 @@ void client_remove_from_session(struct client *c) assert(*ccp == c); *ccp = c->next; + c->database = 0; c->session = 0; c->next = 0; } @@ -866,7 +867,10 @@ struct host *client_get_host(struct client *cl) const char *client_get_url(struct client *cl) { - return client_get_database(cl)->database->url; + if (cl->database) + return client_get_database(cl)->database->url; + else + return "NOURL"; } void client_set_maxrecs(struct client *cl, int v)