From dd6da3de6292dd8d087eac67c0c9a7eced8b88de Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 23 Sep 2009 17:56:53 +0200 Subject: [PATCH] Fix leak for odr_print of ZOOM connection. Calls to ZOOM_connection_connect would odr_print memory each time if option apdulog=1. --- src/zoom-c.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 1.7.10.4