X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fsi%2Fsrc%2Fsi95%2Fsiwait.c;h=291b8aad807b515052b3eede2e3355c2bd46da6f;hb=d324fe4bfea9daa22aa16c605bd3157a875a8ccd;hp=128c1a7ecf4b15355fe1f8186e4506a5e5a45a78;hpb=fcea3951d44de0cc55d33c5e114487abe79d3406;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/si/src/si95/siwait.c b/src/rmr/si/src/si95/siwait.c index 128c1a7..291b8aa 100644 --- a/src/rmr/si/src/si95/siwait.c +++ b/src/rmr/si/src/si95/siwait.c @@ -69,7 +69,10 @@ extern int SIwait( struct ginfo_blk *gptr ) { char *buf; char *ibuf; - ibuf = (char *) malloc( 2048 ); + if( ( ibuf = (char *) malloc( 2048 ) ) == NULL ) { + rmr_vlog( RMR_VL_WARN, "ibuf malloc fail\n" ); + return SI_ERROR; + } if( gptr->flags & GIF_SHUTDOWN ) { // cannot do if we should shutdown free( ibuf ); @@ -78,6 +81,7 @@ extern int SIwait( struct ginfo_blk *gptr ) { if( gptr->magicnum != MAGICNUM ) { // if not a valid ginfo block rmr_vlog( RMR_VL_CRIT, "SI95: wait: bad global info struct magic number is wrong\n" ); + free( ibuf ); return SI_ERROR; }