-rw-r--r-- | libopie2/opiedb/osqlitedriver.cpp | 9 | ||||
-rw-r--r-- | libopie2/opiedb/osqlitedriver.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp index f07d520..3ba161e 100644 --- a/libopie2/opiedb/osqlitedriver.cpp +++ b/libopie2/opiedb/osqlitedriver.cpp @@ -138,3 +138,2 @@ bool OSQLiteDriver::open() { } - sqreg = (sqregex *)malloc(sizeof(sqreg)); sqlite_create_function(m_sqlite,"rlike",3,rlikeFunc,&sqreg); @@ -151,6 +150,6 @@ bool OSQLiteDriver::close() { sqlite_close( m_sqlite ), m_sqlite=0l; - if (sqreg->regex_raw != NULL){ - free(sqreg->regex_raw); - sqreg->regex_raw=NULL; - regfree(&sqreg->regex_c); + if (sqreg.regex_raw != NULL){ + free(sqreg.regex_raw); + sqreg.regex_raw=NULL; + regfree(&sqreg.regex_c); } diff --git a/libopie2/opiedb/osqlitedriver.h b/libopie2/opiedb/osqlitedriver.h index 95c9e2f..adec331 100644 --- a/libopie2/opiedb/osqlitedriver.h +++ b/libopie2/opiedb/osqlitedriver.h @@ -43,3 +43,3 @@ private: sqlite *m_sqlite; - sqregex *sqreg; + sqregex sqreg; }; |