mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 16:13:40 +00:00
(libretro-common) Prevent more static code analysis warnings
This commit is contained in:
parent
f83f0b2d44
commit
5cfc4defc6
@ -256,13 +256,18 @@ rxml_document_t *rxml_load_document_string(const char *str)
|
|||||||
|
|
||||||
case YXML_ATTRSTART:
|
case YXML_ATTRSTART:
|
||||||
if (attr)
|
if (attr)
|
||||||
attr = attr->next = (struct rxml_attrib_node*)calloc(1, sizeof(*attr));
|
attr = attr->next = (struct rxml_attrib_node*)
|
||||||
|
calloc(1, sizeof(*attr));
|
||||||
else
|
else
|
||||||
attr = node->attrib = (struct rxml_attrib_node*)calloc(1, sizeof(*attr));
|
attr = node->attrib = (struct rxml_attrib_node*)
|
||||||
|
calloc(1, sizeof(*attr));
|
||||||
|
|
||||||
if (attr->attrib)
|
if (attr)
|
||||||
free(attr->attrib);
|
{
|
||||||
attr->attrib = strdup(x.attr);
|
if (attr->attrib)
|
||||||
|
free(attr->attrib);
|
||||||
|
attr->attrib = strdup(x.attr);
|
||||||
|
}
|
||||||
|
|
||||||
valptr = buf->val;
|
valptr = buf->val;
|
||||||
break;
|
break;
|
||||||
@ -280,9 +285,12 @@ rxml_document_t *rxml_load_document_string(const char *str)
|
|||||||
{
|
{
|
||||||
*valptr = '\0';
|
*valptr = '\0';
|
||||||
|
|
||||||
if (attr->value)
|
if (attr)
|
||||||
free(attr->value);
|
{
|
||||||
attr->value = strdup(buf->val);
|
if (attr->value)
|
||||||
|
free(attr->value);
|
||||||
|
attr->value = strdup(buf->val);
|
||||||
|
}
|
||||||
|
|
||||||
valptr = buf->val;
|
valptr = buf->val;
|
||||||
}
|
}
|
||||||
|
@ -549,7 +549,8 @@ int64_t filestream_read_file(const char *path, void **buf, int64_t *len)
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
if (file)
|
if (file)
|
||||||
filestream_close(file);
|
if (filestream_close(file) != 0)
|
||||||
|
free(file);
|
||||||
if (content_buf)
|
if (content_buf)
|
||||||
free(content_buf);
|
free(content_buf);
|
||||||
if (len)
|
if (len)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user