Fix a major memory leak in declare/fetch mode. Ensure that forward only cursors can... REL-08_01_0006
authorDave Page <dpage@pgadmin.org>
Thu, 3 Nov 2005 12:05:13 +0000 (12:05 +0000)
committerDave Page <dpage@pgadmin.org>
Thu, 3 Nov 2005 12:05:13 +0000 (12:05 +0000)
results.c
statement.c

index 903796e68fb14967b9739e4625efa085367807e9..b462d2d8ac777d8a0bbe33d16538b61bc12e36cd 100644 (file)
--- a/results.c
+++ b/results.c
@@ -1157,8 +1157,7 @@ PGAPI_ExtendedFetch(
    }
    ci = &(SC_get_conn(stmt)->connInfo);
 
-   /* if (SC_is_fetchcursor(stmt) && !stmt->manual_result) */
-   if (SQL_CURSOR_FORWARD_ONLY == stmt->options.cursor_type && !stmt->manual_result)
+   if (SQL_CURSOR_FORWARD_ONLY == stmt->options.cursor_type)
    {
        if (fFetchType != SQL_FETCH_NEXT)
        {
index 5827cf372365559cd642ca72a9d0385e7697258b..413703c218b230bb77453b590116f72d65056623 100644 (file)
@@ -932,6 +932,7 @@ SC_fetch(StatementClass *self)
        qi.row_size = ci->drivers.fetch_max;
        sprintf(fetch, "fetch %d in %s",ci->drivers.fetch_max , self->cursor_name);
        res = CC_send_query(self->hdbc, fetch, &qi, qflag);
+       TL_Destructor(self->result->manual_tuples);
        SC_set_Result(self,res);
    }