Skip to content

Commit

Permalink
Merge pull request #31 from rqlite/fix-load-extension
Browse files Browse the repository at this point in the history
Use a nil pointer if entry is ""
  • Loading branch information
otoolep authored Aug 8, 2024
2 parents 7205526 + ffc0202 commit f77bf34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sqlite3_load_extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ func (c *SQLiteConn) LoadExtension(lib string, entry string) error {
return errors.New(C.GoString(C.sqlite3_errmsg(c.db)))
}

if err := c.loadExtension(lib, &entry); err != nil {
var ptr *string
if entry != "" {
ptr = &entry
}
if err := c.loadExtension(lib, ptr); err != nil {
C.sqlite3_enable_load_extension(c.db, 0)
return err
}
Expand Down

0 comments on commit f77bf34

Please sign in to comment.