Changeset: c49f3b64445b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c49f3b64445b
Modified Files:
        monetdb5/mal/mal_dataflow.c
Branch: resource_management
Log Message:

The value "size" is number of (old) elements, so multiply with element size.


diffs (37 lines):

diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -579,14 +579,14 @@ DFLOWinitBlk(DataFlow flow, MalBlkPtr mb
                                                /* in case of realloc failure, 
the original
                                                 * pointers will be freed by 
the caller */
                                                size_t nsz = sizeof(int) * 2 * 
size;
-                                               flow->nodes = (int *) 
ma_realloc(mb->ma, flow->nodes, nsz, size);
+                                               flow->nodes = (int *) 
ma_realloc(mb->ma, flow->nodes, nsz, sizeof(int) * size);
                                                if (flow->nodes == NULL) {
                                                        // GDKfree(assign);
                                                        throw(MAL, "dataflow",
                                                                  
SQLSTATE(HY013) MAL_MALLOC_FAIL);
                                                }
                                                //flow->nodes = tmp;
-                                               flow->edges = (int *) 
ma_realloc(mb->ma, flow->edges, nsz, size);
+                                               flow->edges = (int *) 
ma_realloc(mb->ma, flow->edges, nsz, sizeof(int) * size);
                                                if (flow->edges == NULL) {
                                                        // GDKfree(assign);
                                                        throw(MAL, "dataflow",
@@ -625,14 +625,14 @@ DFLOWinitBlk(DataFlow flow, MalBlkPtr mb
                                                        size_t nsz = 
sizeof(int) * 2 * size;
                                                        /* in case of realloc 
failure, the original
                                                         * pointers will be 
freed by the caller */
-                                                       flow->nodes = (int *) 
ma_realloc(mb->ma, flow->nodes, nsz, size);
+                                                       flow->nodes = (int *) 
ma_realloc(mb->ma, flow->nodes, nsz, sizeof(int) * size);
                                                        if (flow->nodes == 
NULL) {
                                                                
//GDKfree(assign);
                                                                throw(MAL, 
"dataflow",
                                                                          
SQLSTATE(HY013) MAL_MALLOC_FAIL);
                                                        }
                                                        //flow->nodes = tmp;
-                                                       flow->edges = (int *) 
ma_realloc(mb->ma, flow->edges, nsz, size);
+                                                       flow->edges = (int *) 
ma_realloc(mb->ma, flow->edges, nsz, sizeof(int) * size);
                                                        if (flow->edges == 
NULL) {
                                                                
//GDKfree(assign);
                                                                throw(MAL, 
"dataflow",
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to