/
No Free of First Parameter Value
No Free of First Parameter Value
This checks free statement for a parameter object from using a Tizen API such as "system_info_get_value_string" and "system_settings_get_value_string".
but, function list can be modified. (we will add more and more) => this checker should be a general purpose.
thus, checker config can be like below:
{ "code" : "CHECK_FREE_STMT_PARAM" , "name" : "Checking Free Statement for a parameter object" , "type" : "BOTH" , "categoryName" : "Tizen" , "severityCode" : "CRI" , "version" : "2.5.32" , "description" : "You should have free statement for a parameter by calling ${methodName}" , "isActive" : true , "properties" : { "method-list" : "system_info_get_value_string, system_settings_get_value_string" }, "cwe" : 0 } |
- ${methodName} : it should be replaced by a real method name that you found in a source file.
- "method-list" : it should have value that divided by ','(comma). for example, "methodName1,methodName2,methodName3"
you have to check method name that divided by comma.- so far, we have two method name : system_info_get_value_string, system_settings_get_value_string
- for now, we need to check just for second parameter of method :
- you can get this value by calling : String value = Your_Checker.getProperty("method-list");
refer to below example:
Field | Contents | ||
---|---|---|---|
Category | Tizen API (Memory Management) | ||
Severity | Critical | ||
Title | The list of interfaces user needs to release the memory allocated by "System Settings API" | ||
Description | int system_settings_get_value_string(system_settings_key_e key, char ** value) | ||
Bad Code |
| ||
Clean Code |
|
Field | Contents | ||
---|---|---|---|
Category | Tizen API (Memory Management) | ||
Severity | Critical | ||
Title | The list of interfaces user needs to release the memory allocated by "System Information API" | ||
Description | int system_info_get_value_string(system_info_key_e key, char **value); | ||
Bad Code |
| ||
Clean Code |
|
, multiple selections available,
Related content
No Free of Third Parameter Value
No Free of Third Parameter Value
More like this
No Free of Return Value
No Free of Return Value
More like this
Thread Unsafe Function Usage: dbus-glib
Thread Unsafe Function Usage: dbus-glib
More like this
1st Array Index Out Of Bounds
1st Array Index Out Of Bounds
More like this
Main Entities
Main Entities
More like this
Negative atoi() return value is used in Array Index
Negative atoi() return value is used in Array Index
More like this