aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-01-16 08:56:33 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2013-01-16 09:19:22 +0100
commit273a222d7f2d7d2ef2f17f753d16683bde4833a5 (patch)
tree0670d01bd4107fb8015b76f375d28ac0f7982544
parent7a5a67ab7b59749662e5f08a5861cc9c2c21ebd8 (diff)
Fixed memory leaks caused by not freeing bitvector
Especially each data message from SGSN caused two memory leaks, which resulted in increasing memory usage while receiving date from SGSN.
-rw-r--r--src/RLCMACTest.cpp4
-rw-r--r--src/gprs_bssgp_pcu.cpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/RLCMACTest.cpp b/src/RLCMACTest.cpp
index 2ffff8f..843dc21 100644
--- a/src/RLCMACTest.cpp
+++ b/src/RLCMACTest.cpp
@@ -141,6 +141,8 @@ void testRlcMacDownlink()
bitvec_free(vector);
free(data);
}
+
+ bitvec_free(resultVector);
}
@@ -201,6 +203,8 @@ void testRlcMacUplink()
bitvec_free(vector);
free(data);
}
+
+ bitvec_free(resultVector);
}
int main(int argc, char *argv[])
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 6ea9920..aa3153c 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -127,6 +127,7 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
bitvec_read_field(block, rp, 4); // SMS Value
bitvec_read_field(block, rp, 4); // SMS Value
}
+ bitvec_free(block);
}
/* get lifetime */
uint16_t delay_csec = 0xffff;