Changeset: e808ff5920b8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e808ff5920b8
Modified Files:
        sql/server/rel_exp.c
Branch: Aug2011
Log Message:

exp_match_list: use calloc instead of alloca


diffs (25 lines):

diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -539,10 +539,8 @@ exp_match_list( list *l, list *r)
                return l == r;
        if (list_length(l) != list_length(r))
                return 0;
-       lu = alloca(list_length(l));
-       ru = alloca(list_length(r));
-       memset(lu, 0, list_length(l));
-       memset(ru, 0, list_length(r));
+       lu = calloc(list_length(l), sizeof(char));
+       ru = calloc(list_length(r), sizeof(char));
        for (n = l->h, lc = 0; n; n = n->next, lc++) {
                sql_exp *le = n->data;
 
@@ -562,6 +560,8 @@ exp_match_list( list *l, list *r)
        for (n = r->h, rc = 0; n && match; n = n->next, rc++) 
                if (!ru[rc])
                        match = 0;
+       free(lu);
+       free(ru);
        return match;
 }
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to