safely duplicate close

This commit is contained in:
Lion 2022-06-30 18:34:14 +08:00
parent 8ee41f4e1d
commit b8710c17d8
1 changed files with 2 additions and 1 deletions

View File

@ -50,6 +50,7 @@ XDB_PUBLIC(int) xdb_new_with_buffer(xdb_searcher_t *xdb, const char *c_buffer) {
XDB_PUBLIC(void) xdb_close(xdb_searcher_t *xdb) {
if (xdb->handle != NULL) {
fclose(xdb->handle);
xdb->handle = NULL;
}
}