Diffstat (limited to 'libopie2/opiedb/osqlitedriver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiedb/osqlitedriver.cpp | 9 |
1 files changed, 4 insertions, 5 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 @@ -131,33 +131,32 @@ bool OSQLiteDriver::open() { /* failed to open */ if (m_sqlite == 0l ) { // FIXME set the last error qWarning("OSQLiteDriver::open: %s", error ); free( error ); return false; } - sqreg = (sqregex *)malloc(sizeof(sqreg)); sqlite_create_function(m_sqlite,"rlike",3,rlikeFunc,&sqreg); return true; } /* close the db * sqlite closes them without * telling failure or success */ bool OSQLiteDriver::close() { if (m_sqlite ) 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); } return true; } /* Query */ OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { if ( !m_sqlite ) { |