mysqludf/lib_mysqludf_preg

crash with mariadb and jemalloc

Opened this issue · 1 comments

Solved. Not very elegant, but working.
I submit this diff patch which consists in differentiating the two calls at pregMoveToReturnValues made in lib_mysqludf_preg_replace.c and in lib_mysqludf_preg_capture.c with a seventh parameter indicating to pregMoveToReturnValues the way to free the memory allocated to parameter "s" (in lib_mysqludf_preg_replace.c was allocated by pregReplace with memcpyand supposed to be freed by free() and in lib_mysqludf_preg_capture.c was allocated by pcre_get_substring and supposed to be freed by pcre_free_substring() ).

patch.txt