From 5ea4e843c189848da0b41935e7f2db8e41b7c8e7 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 25 Aug 2002 06:48:18 +0000 Subject: [PATCH] Ensure that send_present doesn't use ODR if present is not performed --- zoom/zoom-c.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index dcc71a3..522660a 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.41 2002-08-24 09:28:30 oleg Exp $ + * $Id: zoom-c.c,v 1.42 2002-08-25 06:48:18 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -142,12 +142,6 @@ void ZOOM_connection_remove_task (ZOOM_connection c) assert (0); } xfree (task); - /* - Fix me!!! May be it is not right place for reset of the ODR stream, - but if happens to read records from cache we will be get memory leaks - without it (see send_present()). - */ - odr_reset(c->odr_out); } } @@ -1413,8 +1407,8 @@ static int send_sort (ZOOM_connection c) static int send_present (ZOOM_connection c) { - Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_presentRequest); - Z_PresentRequest *req = apdu->u.presentRequest; + Z_APDU *apdu = 0; + Z_PresentRequest *req = 0; int i = 0; const char *syntax = 0; const char *elementSetName = 0; @@ -1461,6 +1455,9 @@ static int send_present (ZOOM_connection c) if (i == resultset->count) return 0; + apdu = zget_APDU(c->odr_out, Z_APDU_presentRequest); + req = apdu->u.presentRequest; + resultset->start += i; resultset->count -= i; *req->resultSetStartPoint = resultset->start + 1; -- 1.7.10.4