mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-17 16:54:13 +00:00
[Core] scan-build: fix false-positive memory leak in switch_xml_set_attr_d and switch_xml_set_attr_d_buf
This commit is contained in:
1 parent
781180ff48
commit
c35a3bb4db
4 files changed
+11
-10
No files matched your search
+2
-2
@@ -3040,7 +3040,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_set_attr(switch_xml_t xml, const char *n
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_set_attr_d(switch_xml_t xml, const char *name, const char *value)
|
||||
{
|
||||
if (!xml) return NULL;
|
||||
return switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), strdup(name), strdup(switch_str_nil(value)));
|
||||
return switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), switch_must_strdup(name), switch_must_strdup(switch_str_nil(value)));
|
||||
}
|
||||
|
||||
/* Sets the given tag attribute or adds a new attribute if not found. A value
|
||||
@@ -3048,7 +3048,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_set_attr_d(switch_xml_t xml, const char
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_set_attr_d_buf(switch_xml_t xml, const char *name, const char *value)
|
||||
{
|
||||
if (!xml) return NULL;
|
||||
return switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), strdup(name), strdup(value));
|
||||
return switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), switch_must_strdup(name), switch_must_strdup(value));
|
||||
}
|
||||
|
||||
/* sets a flag for the given tag and returns the tag */
|
||||
|
||||
Reference in new issue
Block a user