Changeset: ca9e191a3113 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ca9e191a3113
Modified Files:
        gdk/gdk_select.c
Branch: Jan2022
Log Message:

Fix heap referencing leak.


diffs (39 lines):

diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -1111,8 +1111,10 @@ scanselect(BAT *b, BATiter *bi, struct c
                                /* range bounded on left */             \
                                if (!li) {                              \
                                        /* open range on left */        \
-                                       if (*(TYPE*)tl == MAXVALUE##TYPE) \
+                                       if (*(TYPE*)tl == MAXVALUE##TYPE) { \
+                                               bat_iterator_end(&bi);  \
                                                return BATdense(0, 0, 0); \
+                                       }                               \
                                        /* vl < x === vl+1 <= x */      \
                                        vl.v_##TYPE = 
NEXTVALUE##TYPE(*(TYPE*)tl); \
                                        li = true;                      \
@@ -1129,8 +1131,10 @@ scanselect(BAT *b, BATiter *bi, struct c
                                /* range bounded on right */            \
                                if (!hi) {                              \
                                        /* open range on right */       \
-                                       if (*(TYPE*)th == MINVALUE##TYPE) \
+                                       if (*(TYPE*)th == MINVALUE##TYPE) { \
+                                               bat_iterator_end(&bi);  \
                                                return BATdense(0, 0, 0); \
+                                       }                               \
                                        /* x < vh === x <= vh-1 */      \
                                        vh.v_##TYPE = 
PREVVALUE##TYPE(*(TYPE*)th); \
                                        hi = true;                      \
@@ -1143,8 +1147,10 @@ scanselect(BAT *b, BATiter *bi, struct c
                                th = &vh.v_##TYPE;                      \
                                hval = true;                            \
                        }                                               \
-                       if (*(TYPE*)tl > *(TYPE*)th)                    \
+                       if (*(TYPE*)tl > *(TYPE*)th) {                  \
+                               bat_iterator_end(&bi);                  \
                                return BATdense(0, 0, 0);               \
+                       }                                               \
                }                                                       \
                assert(lval);                                           \
                assert(hval);                                           \
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to