From: Adam Dickmeiss Date: Wed, 23 Sep 2009 15:56:53 +0000 (+0200) Subject: Fix leak for odr_print of ZOOM connection. X-Git-Tag: v3.0.49~9 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=dd6da3de6292dd8d087eac67c0c9a7eced8b88de;p=yaz-moved-to-github.git Fix leak for odr_print of ZOOM connection. Calls to ZOOM_connection_connect would odr_print memory each time if option apdulog=1. --- diff --git a/src/zoom-c.c b/src/zoom-c.c index fbade55..d0f5042 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -406,6 +406,7 @@ ZOOM_API(ZOOM_connection) c->odr_in = odr_createmem(ODR_DECODE); c->odr_out = odr_createmem(ODR_ENCODE); + c->odr_print = 0; c->async = 0; c->support_named_resultsets = 0; @@ -479,6 +480,11 @@ ZOOM_API(void) set_ZOOM_error(c, ZOOM_ERROR_NONE, 0); ZOOM_connection_remove_tasks(c); + if (c->odr_print) + { + odr_setprint(c->odr_print, 0); /* prevent destroy from fclose'ing */ + odr_destroy(c->odr_print); + } if (ZOOM_options_get_bool(c->options, "apdulog", 0)) { c->odr_print = odr_createmem(ODR_PRINT);