Comments (9)
i try to add dTHX to free_embedded_options function , gmake success
int free_embedded_options(char ** options_list, int options_count)
{
int i;
dTHX;
for (i= 0; i < options_count; i++)
{
if (options_list[i])
free(options_list[i]);
}
free(options_list);
return 1;
}
from dbd-mariadb.
This is incorrect. Memory which is going to be freed by free()
call in free_embedded_options
is allocated in fill_out_embedded_options
by calloc()
call.
Perl headers file replaces malloc()
and free()
calls by own memory management. But does not replaces calloc()
call.
On some systems those functions just calls system's malloc()
and free()
functions, therefore everything is safe. (Seems that all Linux machines which I tested). But error which you got on Windows indicates that it really has own memory management (needs that dTHX;
) and calling Perl's free()
on memory allocated by Windows native calloc()
would for sure cause memory corruptions...
Correct way is to stop using calloc()
and free()
and uses Perl's Newz()
and Safefree()
replacment.
from dbd-mariadb.
though I don't know what you are talking about, replace free to Safefree , gmake success.
thank you .
int free_embedded_options(char ** options_list, int options_count)
{
int i;
for (i= 0; i < options_count; i++)
{
if (options_list[i])
Safefree(options_list[i]);
}
Safefree(options_list);
return 1;
}
from dbd-mariadb.
though I don't know what you are talking about
That for allocation of memory calloc
must be avoided and instead Newz
should be used. And for releasing memory allocated by Newz
should be used Safefree
call.
from dbd-mariadb.
Will you prepare a proper fix for it?
from dbd-mariadb.
Patch for guarding calloc
for perl itself is in following RT ticket: https://rt.perl.org/Public/Bug/Display.html?id=133550
from dbd-mariadb.
Ok, I did in in pull request #94. Please check.
from dbd-mariadb.
Ok, I did in in pull request #94. Please check.
git clone https://github.com/pali/DBD-MariaDB.git
perl Makefile.PL --mysql_config=c:/path/mysql_config.bat
gmake
gmake install
success
from dbd-mariadb.
Ok, therefore it is fixed, closing.
from dbd-mariadb.
Related Issues (20)
- test case fails with mysql 8.0.22 HOT 11
- support for mysql_enable_utf8 HOT 7
- mariadb_st_finish() does not check mariadb_db_async_result() failure
- Add a missing break to 'MYSQL_TYPE_NULL' case in mariadb_st_describe()
- Test failures with MariaDB-10.6.4 + libmariadb3-3.2.3 HOT 9
- BUG? Can't find 'boot_DBD__MariaDB' in Windows/StrawberryPerl using distro DBD::MariaDB HOT 1
- MySQL server has gone away HOT 1
- t/40server_prepare.t fails HOT 3
- DBD-MariaDB-1.22: Build warnings HOT 5
- SIGPIPE ignored, resulting in: "Unable to flush stdout: Broken pipe" HOT 5
- `mariadb_use_result` is broken HOT 13
- BLOB as parameter in execute HOT 2
- As of MySQL 8.0.34 and 8.1.0 's libmysqlclients deprecates MYSQL_OPT_RECONNECT HOT 2
- Replace compile time version detection by runtime version detection
- Test MariaDB 10.5+ and MySQL 8.1+ server versions in Github Actions CI HOT 1
- failed: SSL connection error: Enforcing SSL encryption is not supported HOT 2
- DBD-MariaDB does not check "Active" on database handles when preparing / executing HOT 2
- Passing credentials via options file fails to read password (mariadb_read_default_file) HOT 3
- Options to the driver mysql_enable_utf8mb4 and mysql_enable_utf8 are not recognised HOT 5
- DBD::MariaDB 1.23 not updating cardinality in MariaDB 10.6.5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbd-mariadb.