summaryrefslogtreecommitdiff
path: root/libopie2
Side-by-side diff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiedb/osqlitedriver.cpp9
-rw-r--r--libopie2/opiedb/osqlitedriver.h2
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
@@ -135,9 +135,8 @@ bool OSQLiteDriver::open() {
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;
}
@@ -148,12 +147,12 @@ bool OSQLiteDriver::open() {
*/
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;
}
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
@@ -40,9 +40,9 @@ private:
int handleCallBack( int, char**, char** );
static int call_back( void*, int, char**, char** );
QString m_url;
sqlite *m_sqlite;
- sqregex *sqreg;
+ sqregex sqreg;
};
}
}
}