Sonar identified some potential memory leaks in the run function
of the xapp class. This change addresses those issues, and ensures
that the unused parameter grumblings which were attempted to be
corrected in the last change are also addressed.
Issue-ID: RIC-629
Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Change-Id: I2fe2f4b681780cd60235a0c38ed4709af871abbe
# squished to one.
release = Cherry
# squished to one.
release = Cherry
+2020 13 August; version 2.2.2
+ Correct potential memory leaks in xapp class (RIC-629)
+
2020 July 31; version 2.2.1
Correct "bugs" according to sonar (RIC-629)
2020 July 31; version 2.2.1
Correct "bugs" according to sonar (RIC-629)
set( major_version "2" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
set( minor_version "2" )
set( major_version "2" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
set( minor_version "2" )
set( install_root "${CMAKE_INSTALL_PREFIX}" )
set( install_inc "include/ricxfcpp" )
set( install_root "${CMAKE_INSTALL_PREFIX}" )
set( install_inc "include/ricxfcpp" )
Cherry Release
==============
Cherry Release
==============
+2020 13 August; version 2.2.2
+-----------------------------
+Correct potential memory leaks in xapp class (RIC-629)
+
+
2020 July 31; version 2.2.1
---------------------------
Correct "bugs" according to sonar (RIC-629)
2020 July 31; version 2.2.1
---------------------------
Correct "bugs" according to sonar (RIC-629)
+
+ free( dname );
+ free( bname );
- st = st; // silly things to keep sonar from complaining
- name = name;
- se = se;
- data = data;
-
if( (j = (jthing_t *) ele) == NULL ) {
if( (j = (jthing_t *) ele) == NULL ) {
+ if( st == NULL && name == NULL && se == NULL && data == NULL ) { // these are ignored, but this keeps sonar from screaming bug
+ fprintf( stderr, "jwrapper: nix_thigs: all params were nil\n" );
+ }
symtab code which defines the set of params and we use what we need.
*/
static void nix_mgt( void* st, void* se, const char* name, void* ele, void *data ) {
symtab code which defines the set of params and we use what we need.
*/
static void nix_mgt( void* st, void* se, const char* name, void* ele, void *data ) {
- st = st; // silly things to keep sonar from complaining (let's hope the compiler is better than sonar
- name = name; // and optimises these out).
- se = se;
- data = data;
+
+ if( ele == NULL ) {
+ if( st == NULL && name == NULL && se == NULL && data == NULL ) { // these are ignored, but this keeps sonar from screaming bug
+ fprintf( stderr, "jwrapper: dump_things: all params were nil\n" );
+ }
+
+ return;
+ }
static void dump_things( void* st, void* se, const char* name, void* ele, void *data ) {
const jthing_t* j;
static void dump_things( void* st, void* se, const char* name, void* ele, void *data ) {
const jthing_t* j;
- st = st; // silly things to keep sonar from complaining (let's hope the compiler is better than sonar
- name = name; // and optimises these out).
- se = se;
- data = data;
-
j = (jthing_t *) ele;
if( j ) {
fprintf( stderr, "<DBUG> jwrapper: element '%s' has ptype %d, jsmn type %d\n", name, j->prim_type, j->jsmn_type );
} else {
j = (jthing_t *) ele;
if( j ) {
fprintf( stderr, "<DBUG> jwrapper: element '%s' has ptype %d, jsmn type %d\n", name, j->prim_type, j->jsmn_type );
} else {
+ if( st == NULL && name == NULL && se == NULL && data == NULL ) { // these are ignored, but this keeps sonar from screaming bug
+ fprintf( stderr, "jwrapper: dump_things: all params were nil\n" );
+ }
fprintf( stderr, "<DBUG> jwrapper: element has no data: '%s'\n", name );
}
}
fprintf( stderr, "<DBUG> jwrapper: element has no data: '%s'\n", name );
}
}
+# order here is important to ensure coverage files accumulate
+tests="metrics_test jhash_test config_test unit_test"
+
#run everything, then generate coverage stats after all have run
#run everything, then generate coverage stats after all have run
-for x in metrics_test jhash_test config_test unit_test
do
./$x >/tmp/PID$$.log 2>&1
abort_if_error $? "test failed: $x"
do
./$x >/tmp/PID$$.log 2>&1
abort_if_error $? "test failed: $x"
# it seems that we loose coverage reporting if metrics_test's gcov file is generated
# after unit test. Very strange. To be safe, run unit_test last.
#
# it seems that we loose coverage reporting if metrics_test's gcov file is generated
# after unit test. Very strange. To be safe, run unit_test last.
#
-for x in metrics_test jhash_test config_test unit_test
do
gcov $x.c >/dev/null 2>&1
done
do
gcov $x.c >/dev/null 2>&1
done