Memory leak reading access control configuration
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
a0d7b71e52
commit
fa6dbe6c3d
1 changed files with 17 additions and 13 deletions
|
@ -2063,23 +2063,27 @@ read_document(
|
||||||
char **doc,
|
char **doc,
|
||||||
DDS_Security_SecurityException *ex)
|
DDS_Security_SecurityException *ex)
|
||||||
{
|
{
|
||||||
bool result = true;
|
|
||||||
char *data = NULL;
|
char *data = NULL;
|
||||||
|
|
||||||
switch (DDS_Security_get_conf_item_type(doc_uri, &data))
|
switch (DDS_Security_get_conf_item_type(doc_uri, &data))
|
||||||
{
|
{
|
||||||
case DDS_SECURITY_CONFIG_ITEM_PREFIX_DATA:
|
case DDS_SECURITY_CONFIG_ITEM_PREFIX_DATA:
|
||||||
*doc = data;
|
*doc = data;
|
||||||
break;
|
return true;
|
||||||
case DDS_SECURITY_CONFIG_ITEM_PREFIX_FILE:
|
|
||||||
result = read_document_from_file(data, doc, ex);
|
case DDS_SECURITY_CONFIG_ITEM_PREFIX_FILE: {
|
||||||
|
const bool result = read_document_from_file(data, doc, ex);
|
||||||
ddsrt_free(data);
|
ddsrt_free(data);
|
||||||
break;
|
return result;
|
||||||
default:
|
}
|
||||||
|
|
||||||
|
case DDS_SECURITY_CONFIG_ITEM_PREFIX_PKCS11:
|
||||||
|
case DDS_SECURITY_CONFIG_ITEM_PREFIX_UNKNOWN:
|
||||||
DDS_Security_Exception_set(ex, DDS_ACCESS_CONTROL_PLUGIN_CONTEXT, DDS_SECURITY_ERR_URI_TYPE_NOT_SUPPORTED_CODE, 0, DDS_SECURITY_ERR_URI_TYPE_NOT_SUPPORTED_MESSAGE, doc_uri);
|
DDS_Security_Exception_set(ex, DDS_ACCESS_CONTROL_PLUGIN_CONTEXT, DDS_SECURITY_ERR_URI_TYPE_NOT_SUPPORTED_CODE, 0, DDS_SECURITY_ERR_URI_TYPE_NOT_SUPPORTED_MESSAGE, doc_uri);
|
||||||
|
ddsrt_free(data);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return result;
|
assert (0);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue