From 84a0d86f2cc69d6a60c4a14039ed2a793fdd2900 Mon Sep 17 00:00:00 2001 From: noctuum <25441068+noctuum@users.noreply.github.com> Date: Fri, 18 Sep 2026 23:14:43 +0500 Subject: [PATCH] Own the fault string in xmlrpc_error_c xmlrpc_env_set_fault frees the buffer the pointer came from. --- src/rpc/xmlrpc_c.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/xmlrpc_c.cc b/src/rpc/xmlrpc_c.cc index e9605e25..b85142f4 100644 --- a/src/rpc/xmlrpc_c.cc +++ b/src/rpc/xmlrpc_c.cc @@ -27,11 +27,11 @@ public: virtual ~xmlrpc_error_c() throw() {} virtual int type() const throw() { return m_type; } - virtual const char* what() const throw() { return m_msg; } + virtual const char* what() const throw() { return m_msg.c_str(); } private: int m_type; - const char* m_msg; + std::string m_msg; }; torrent::Object xmlrpc_to_object(xmlrpc_env* env, xmlrpc_value* value, int call_type = 0, rpc::target_type* target = NULL, std::function* deleter = NULL);