diff --git a/src/osal.h b/src/osal.h index 22bd84d3..5aabc191 100644 --- a/src/osal.h +++ b/src/osal.h @@ -430,7 +430,7 @@ static __inline size_t mdbx_syspagesize(void) { } #ifndef mdbx_strdup -char *mdbx_strdup(const char *str); +LIBMDBX_API char *mdbx_strdup(const char *str); #endif static __inline int mdbx_get_errno(void) { diff --git a/src/tools/mdbx_chk.c b/src/tools/mdbx_chk.c index 160b0947..6614bdb2 100644 --- a/src/tools/mdbx_chk.c +++ b/src/tools/mdbx_chk.c @@ -164,7 +164,7 @@ static walk_dbi_t *pagemap_lookup_dbi(const char *dbi_name, bool silent) { return NULL; } - dbi->name = strdup(dbi_name); + dbi->name = mdbx_strdup(dbi_name); if (verbose > 1 && !silent) { print(" - found '%s' area\n", dbi_name); fflush(NULL); diff --git a/src/tools/mdbx_load.c b/src/tools/mdbx_load.c index 661336c6..697e3e16 100644 --- a/src/tools/mdbx_load.c +++ b/src/tools/mdbx_load.c @@ -111,7 +111,7 @@ static void readhdr(void) { *ptr = '\0'; if (subname) mdbx_free(subname); - subname = strdup((char *)dbuf.iov_base + STRLENOF("database=")); + subname = mdbx_strdup((char *)dbuf.iov_base + STRLENOF("database=")); } else if (!strncmp(dbuf.iov_base, "type=", STRLENOF("type="))) { if (strncmp((char *)dbuf.iov_base + STRLENOF("type="), "btree", STRLENOF("btree"))) { @@ -349,7 +349,7 @@ int main(int argc, char *argv[]) { envflags |= MDBX_NOSUBDIR; break; case 's': - subname = strdup(optarg); + subname = mdbx_strdup(optarg); break; case 'N': putflags = MDBX_NOOVERWRITE | MDBX_NODUPDATA;