Fix a memory leak pointed out by pluto.cobain.
authorHiroshi Inoue <inoue@tpf.co.jp>
Fri, 4 Jul 2014 03:52:49 +0000 (12:52 +0900)
committerHiroshi Inoue <inoue@tpf.co.jp>
Fri, 4 Jul 2014 03:52:49 +0000 (12:52 +0900)
qresult.c

index a1c8bf7cf324f0f6f58a53d3035af334e8a0ae28..7605892e27b7bbecf970d095fb056a9fa1fa3010 100644 (file)
--- a/qresult.c
+++ b/qresult.c
@@ -945,7 +945,7 @@ inolog("in total_read=%d cursT=%d currT=%d ad=%d total=%d rowsetSize=%d\n", self
    if (0 != self->move_offset)
    {
        char        movecmd[256];
-       QResultClass    *mres;
+       QResultClass    *mres = NULL;
        SQLULEN     movement, moved;
 
        movement = self->move_offset;
@@ -1019,6 +1019,7 @@ inolog("FETCH LAST case\n");
                        self->tupleField = NULL;
                        SC_set_rowset_start(stmt, -1, TRUE);
                        stmt->currTuple = -1;
+                       QR_Destructor(mres);
                        RETURN(-1)
                    }
                    back_offset = QR_get_num_total_tuples(self) - backpt;