-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard-openlmi.rhcloud.com/r/1282/#review1786
-----------------------------------------------------------
Autoscan finished with errors:
Error: FORWARD_NULL (CWE-476):
openlmi-networking-0.2.1_5_g2eb5ae6/src/activeconnection.c:32: var_compare_op: Comparing
"activeConnection" to null implies that "activeConnection" might be
null.
openlmi-networking-0.2.1_5_g2eb5ae6/src/activeconnection.c:35: var_deref_op: Dereferencing
null pointer "activeConnection".
Error: CLANG_WARNING:
openlmi-networking-0.2.1_5_g2eb5ae6/src/activeconnection.c:35:31: warning: Access to field
'network' results in a dereference of a null pointer (loaded from variable
'activeConnection')
# activeConnection->network = network;
# ~~~~~~~~~~~~~~~~ ^
Error: FORWARD_NULL (CWE-476):
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:35: var_compare_op: Comparing
"connection" to null implies that "connection" might be null.
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:38: var_deref_op: Dereferencing null
pointer "connection".
Error: CLANG_WARNING:
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:38:25: warning: Access to field
'network' results in a dereference of a null pointer (loaded from variable
'connection')
# connection->network = network;
# ~~~~~~~~~~ ^
Error: CLANG_WARNING:
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:41:19: warning: Memory is never
released; potential leak of memory pointed to by 'connection'
# error("Memory allocation failed");
# ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/openlmi/openlmi.h:159:73: note: expanded from macro 'lmi_error'
##define lmi_error(...) _lmi_debug(_LMI_DEBUG_ERROR, __FILE__, __LINE__, __VA_ARGS__)
# ^
Error: RESOURCE_LEAK (CWE-772):
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:34: alloc_fn: Storage is returned
from allocation function "malloc(size_t)".
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:34: var_assign: Assigning:
"connection" = storage returned from "malloc(80UL)".
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:42: leaked_storage: Variable
"connection" going out of scope leaks the storage it points to.
Error: FORWARD_NULL (CWE-476):
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:227: var_compare_op: Comparing
"connection->master_id" to null implies that
"connection->master_id" might be null.
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:234: var_deref_model: Passing null
pointer "connection->master_id" to function "strcmp(char const *, char
const *)", which dereferences it.
Error: CLANG_WARNING:
openlmi-networking-0.2.1_5_g2eb5ae6/src/connection.c:234:14: warning: Null pointer passed
as an argument to a 'nonnull' parameter
# if ((strcmp(connection->master_id, c->id)) == 0 ||
# ^ ~~~~~~~~~~~~~~~~~~~~~
Scanned reviews: 1282,1283
- scanbot
On Nov. 25, 2013, 11:23 a.m., Jan Safranek wrote:
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard-openlmi.rhcloud.com/r/1282/
-----------------------------------------------------------
(Updated Nov. 25, 2013, 11:23 a.m.)
Review request for OpenLMI Developers.
Repository: openlmi-networking
Description
-------
Add few errors to trail reviewbot.
This patch is not intended for submitting.
Diffs
-----
src/activeconnection.c c12896d89a3eeb5018b5e92c149a8e12b38b38e6
Diff:
http://reviewboard-openlmi.rhcloud.com/r/1282/diff/
Testing
-------
Thanks,
Jan Safranek