# HG changeset patch # User Olaf Wintermann # Date 1732810819 -3600 # Node ID c949c6ab5346437d4a898d7563fd51869999b7de # Parent b71598a22e1132ea0d84f60cf7973d5c4b111613 fix crash in printxmldoc, fixes #514 diff -r b71598a22e11 -r c949c6ab5346 dav/main.c --- a/dav/main.c Thu Nov 28 17:18:43 2024 +0100 +++ b/dav/main.c Thu Nov 28 17:20:19 2024 +0100 @@ -2402,7 +2402,7 @@ CxMap *nsmap = cxHashMapCreate(cxDefaultAllocator, CX_STORE_POINTERS, 16); cxDefineDestructor(nsmap, free); - cxMapPut(nsmap, cx_hash_key_str(rootns), "x0"); + cxMapPut(nsmap, cx_hash_key_str(rootns), strdup("x0")); fprintf(out, "%s", "\n"); fprintf(out, "", root, rootns); @@ -2411,7 +2411,6 @@ fprintf(out, "\n", root); // cleanup namespace map - cxMapRemove(nsmap, cx_hash_key_str(rootns)); cxMapDestroy(nsmap); }