Code Review
/
ric-plt
/
lib
/
rmr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Address potential error state after good send
[ric-plt/lib/rmr.git]
/
src
/
rmr
/
common
/
src
/
rt_generic_static.c
diff --git
a/src/rmr/common/src/rt_generic_static.c
b/src/rmr/common/src/rt_generic_static.c
index
d19c839
..
816e18a
100644
(file)
--- a/
src/rmr/common/src/rt_generic_static.c
+++ b/
src/rmr/common/src/rt_generic_static.c
@@
-178,8
+178,9
@@
static char* ensure_nlterm( char* buf ) {
memcpy( nb, buf, len );
*(nb+len) = '\n'; // insert \n and nil into the two extra bytes we allocated
*(nb+len+1) = 0;
memcpy( nb, buf, len );
*(nb+len) = '\n'; // insert \n and nil into the two extra bytes we allocated
*(nb+len+1) = 0;
- free( buf );
}
}
+
+ free( buf );
}
}
}
}
@@
-200,7
+201,7
@@
static rtable_ent_t* uta_add_rte( route_table_t* rt, uint64_t key, int nrrgroups
}
if( (rte = (rtable_ent_t *) malloc( sizeof( *rte ) )) == NULL ) {
}
if( (rte = (rtable_ent_t *) malloc( sizeof( *rte ) )) == NULL ) {
- fprintf( stderr, "rmr_add_rte: malloc failed for entry\n" );
+ fprintf( stderr, "
[ERR]
rmr_add_rte: malloc failed for entry\n" );
return NULL;
}
memset( rte, 0, sizeof( *rte ) );
return NULL;
}
memset( rte, 0, sizeof( *rte ) );
@@
-225,7
+226,7
@@
static rtable_ent_t* uta_add_rte( route_table_t* rt, uint64_t key, int nrrgroups
rmr_sym_map( rt->hash, key, rte ); // add to hash using numeric mtype as key
rmr_sym_map( rt->hash, key, rte ); // add to hash using numeric mtype as key
- if( DEBUG ) fprintf( stderr, "[DBUG] route table entry created: k=%l
x groups=%d\n",
key, nrrgroups );
+ if( DEBUG ) fprintf( stderr, "[DBUG] route table entry created: k=%l
lx groups=%d\n", (long long)
key, nrrgroups );
return rte;
}
return rte;
}