Closed andrewchambers closed 4 years ago
Also:
Db *db = initdb(name, conn, options);
paniconerr(err);
This leaks db's, you should not panic before cleaning up the error in some way, or assigning it to an abstract value that will have it's GC called.
Thanks a lot. You can be sure, that my C-fu is minimal, mostly copied from janet-lang/sqlite3 and some LevelDB C examples :-). Will fix!
The first part I hope fixed. Now to the second one. Am I leaking DB, even if it is GCed?
oh no you are right, the second one is my mistake lol.
Yo, saw this lib, there is a mistake here:
You are only freeing the error if it is NULL, which won't do anything. Otherwise you are leaking the error message if you were indeed meant to free it. (I didn't read the leveldb docs)
another bit of feedback, The null assignment here doesn't do anything.