From 6a6358af4805bd10069fb894fecec7f8cfe90b84 Mon Sep 17 00:00:00 2001 From: lion Date: Sat, 13 Aug 2022 11:49:18 +0800 Subject: [PATCH] remove the unused ptr reported at https://github.com/lionsoul2014/ip2region/issues/254 --- binding/c/xdb_searcher.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/binding/c/xdb_searcher.c b/binding/c/xdb_searcher.c index 3166f95..9c13228 100644 --- a/binding/c/xdb_searcher.c +++ b/binding/c/xdb_searcher.c @@ -275,7 +275,6 @@ XDB_PUBLIC(void) xdb_close_vector_index(void *ptr) { XDB_PUBLIC(xdb_content_t *) xdb_load_content(FILE *handle) { unsigned int size; xdb_content_t *content; - char *ptr; // determine the file size if (fseek(handle, 0, SEEK_END) == -1) { @@ -303,7 +302,7 @@ XDB_PUBLIC(xdb_content_t *) xdb_load_content(FILE *handle) { // read the content into the buffer content->length = size; if (fread(content->buffer, 1, size, handle) != size) { - xdb_free(ptr); + xdb_free(content); return NULL; }