Fix Coverity Scan CID 21666 (Variable measResultListEUTRA2 going out of scope leaks the storage it points to.)

This commit is contained in:
Dong Anyuan
2019-06-20 12:43:44 +09:00
parent dc8b2c1ef0
commit 2a8ed1a056
+5
View File
@@ -4231,9 +4231,14 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
if(enc_rval.encoded == -1) {
LOG_I(RRC, "[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
free(measResultListEUTRA2);
measResultListEUTRA2 = NULL;
return -1;
}
free(measResultListEUTRA2);
measResultListEUTRA2 = NULL;
return((enc_rval.encoded+7)/8);
}