* Merging revisions r43354 from trunk:

------------------------------------------------------------------------
    r43354 | michael | 2019-11-02 11:28:27 +0100 (Sat, 02 Nov 2019) | 1 line
    
    * Patch from Michal Gawrycki to handle duplicating strings (bug ID 36243)
    ------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@43732 -
This commit is contained in:
michael 2019-12-23 13:33:07 +00:00
parent 00f800b0dd
commit 33e004a0a3

View File

@ -50,6 +50,16 @@ begin
ReallocMem(Result, size);
end;
function fpcxmlStrdup(str: pchar): pchar; EXTDECL;
var
L: SizeInt;
begin
L := Length(str) + 1;
Getmem(Result, L);
if Result <> nil then
Move(str^, Result^, L);
end;
procedure fpcxmlStructuredErrorHandler(userData: pointer; error: xmlErrorPtr); EXTDECL;
begin
writeln('struct error');
@ -303,7 +313,7 @@ initialization
(*
* overloading the memory functions
*)
xmlMemSetup(@fpcxmlFree, @fpcxmlMalloc, @fpcxmlRealloc, nil);
xmlMemSetup(@fpcxmlFree, @fpcxmlMalloc, @fpcxmlRealloc, @fpcxmlStrdup);
(*
* overloading the error functions