X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fclient.c;h=426b2897a2423ce30d3cd2a10c10fe31371d34cf;hb=97812949e1bb99743c25e572cc1a3fde483931f3;hp=189bb61b2a2d19b77636fa602617e89a9628b73e;hpb=3afba942f18d45ecb55fca52cd8dc7eaee03ee55;p=pazpar2-moved-to-github.git diff --git a/src/client.c b/src/client.c index 189bb61..426b289 100644 --- a/src/client.c +++ b/src/client.c @@ -969,6 +969,8 @@ int client_destroy(struct client *c) xfree(c->addinfo); c->addinfo = 0; xfree(c->id); + xfree(c->sort_strategy); + xfree(c->sort_criteria); assert(!c->connection); facet_limits_destroy(c->facet_limits); @@ -1369,7 +1371,6 @@ int client_parse_query(struct client *cl, const char *query, int client_parse_sort(struct client *cl, struct reclist_sortparms *sp) { - struct session *se = client_get_session(cl); if (sp) { const char *sort_strategy_and_spec = @@ -1396,18 +1397,24 @@ int client_parse_sort(struct client *cl, struct reclist_sortparms *sp) if (!cl->sort_criteria || strcmp(cl->sort_criteria, p)) cl->same_search = 0; if (cl->same_search == 0) { - cl->sort_strategy = nmem_strdup(se->nmem, strategy); - cl->sort_criteria = nmem_strdup(se->nmem, p); + xfree(cl->sort_strategy); + cl->sort_strategy = xstrdup(strategy); + xfree(cl->sort_criteria); + cl->sort_criteria = xstrdup(p); } } else { yaz_log(YLOG_LOG, "Client %s: Invalid sort strategy and spec found %s", client_get_id(cl), sort_strategy_and_spec); + xfree(cl->sort_strategy); cl->sort_strategy = 0; + xfree(cl->sort_criteria); cl->sort_criteria = 0; } } else { yaz_log(YLOG_LOG, "Client %s: No sort strategy and spec found.", client_get_id(cl)); + xfree(cl->sort_strategy); cl->sort_strategy = 0; + xfree(cl->sort_criteria); cl->sort_criteria = 0; }