- Prevent accessing out of array
- Free before exit
Change-Id: Ifbe15353753438efb1b0f79951121d717cd57038
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
break;
}
}
- if (!runtime[rt].xml_prop) {
+ if (rt == LANG_MAX || !runtime[rt].xml_prop) {
printf("Invalid language (%s)\n", optarg);
return 0;
}
API int system_info_get_custom_type(const char *key, system_info_type_e *type)
{
int ret;
- char *val;
+ char *val = NULL;
size_t len;
ret = system_info_get_type(TAG_TYPE_CUSTOM, key, type);
*type = SYSTEM_INFO_STRING;
else {
_E("Invalid type (%s)", val);
+ free(val);
return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
}
+ free(val);
return SYSTEM_INFO_ERROR_NONE;
//LCOV_EXCL_STOP
}