From: Jakub Skoczen Date: Wed, 13 Feb 2013 11:51:44 +0000 (+0100) Subject: Fix potential memory leak in query handling X-Git-Tag: v1.3~9 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=814686f26bd62728b5255c4e88da5e022ec5aef0;p=yaz4j-moved-to-github.git Fix potential memory leak in query handling --- diff --git a/src/main/java/org/yaz4j/Connection.java b/src/main/java/org/yaz4j/Connection.java index 49d5aea..3331052 100644 --- a/src/main/java/org/yaz4j/Connection.java +++ b/src/main/java/org/yaz4j/Connection.java @@ -95,11 +95,11 @@ public class Connection { } SWIGTYPE_p_ZOOM_resultset_p yazResultSet = yaz4jlib.ZOOM_connection_search( zoomConnection, yazQuery); + yaz4jlib.ZOOM_query_destroy(yazQuery); ZoomException err = ExceptionUtil.getError(zoomConnection, host, port); if (err != null) { yaz4jlib.ZOOM_resultset_destroy(yazResultSet); - yaz4jlib.ZOOM_query_destroy(yazQuery); throw err; } return new ResultSet(yazResultSet, this);