Changeset: 0a28ea7ea031 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0a28ea7ea031
Modified Files:
        monetdb5/modules/mal/pcre.c
Branch: default
Log Message:

PCRE error handling
Don't leave dangling temporary BATs around upon errors.


diffs (21 lines):

diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -1261,6 +1261,8 @@ BATPCRElike3(bat *ret, int *bid, str *pa
                        if ( !*isens)
                                options |= PCRE_CASELESS;
                        if ((re = pcre_compile(ppat, options, &err_p, &errpos, 
NULL)) == NULL) {
+                               BBPreleaseref(strs->batCacheid);
+                               BBPreleaseref(r->batCacheid);
                                throw(MAL, "pcre.match", OPERATION_FAILED
                                                ": compilation of regular 
expression (%s) failed "
                                                "at %d with '%s'", ppat, 
errpos, err_p);
@@ -1276,6 +1278,8 @@ BATPCRElike3(bat *ret, int *bid, str *pa
                                else if (pos == -1)
                                        br[i] = *not? TRUE: FALSE;
                                else {
+                                       BBPreleaseref(strs->batCacheid);
+                                       BBPreleaseref(r->batCacheid);
                                        throw(MAL, "pcre.match", 
OPERATION_FAILED
                                                        ": matching of regular 
expression (%s) failed with %d", ppat, pos);
                                }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to