db: Set free'd pointers to NULL to avoid double free
db: Test type requested matched type in memory db
shared: Free memory allocated to static structs