[Pdatabase-cvs] pdb/src pdb.c,1.14,1.15 pdb_types.c,1.11,1.12
Brought to you by:
paralizer
|
From: Michael L. <par...@us...> - 2005-02-22 01:38:05
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21163/src Modified Files: pdb.c pdb_types.c Log Message: Fixed segfault on pdb_del() calls. Index: pdb.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- pdb.c 18 Feb 2005 21:25:29 -0000 1.14 +++ pdb.c 22 Feb 2005 01:37:56 -0000 1.15 @@ -32,6 +32,7 @@ #include "pdb_parse.h" #include "pdb_types.h" #include "list.h" +#include "binarytree.h" /*int main(int argc, char** argv) { printf(PDB_COMPILE_INFO); @@ -347,6 +348,7 @@ */ int pdb_del(struct pdb* dbptr, char* path) { struct pdb_node_t* nptr; + int ret; if (!dbptr) return 0; @@ -360,7 +362,7 @@ /* * Free the node. */ - pdb_free_node(nptr); + ret = pdb_free_node(nptr); /* * Schedule a disk write. @@ -368,7 +370,7 @@ dbptr->altered = 1; PDB_MUTEX_UNLOCK(dbptr); - return pdb_free_node(nptr); + return ret; } Index: pdb_types.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb_types.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- pdb_types.c 18 Feb 2005 21:25:29 -0000 1.11 +++ pdb_types.c 22 Feb 2005 01:37:56 -0000 1.12 @@ -426,6 +426,9 @@ int pdb_free_node(struct pdb_node_t* nptr) { struct pdb_node_types_t* tiptr; + if (!nptr) + return 0; + /* * Free data container. */ |