diff options
author | Ben Chan <benchan@chromium.org> | 2017-08-03 14:49:59 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-08-04 15:07:56 +0200 |
commit | e33aa01963172a138833fbf84e54ef6b537c93bd (patch) | |
tree | 9e85b3f119115bbaa3c14eba0dfff5dec118f644 /src/mm-sim-qmi.c | |
parent | 24ed8d3e997cb6dd30335a534e24dab467752b53 (diff) |
location-gps-nmea: fix memory leaks
There are potential memory leaks in MMLocationGpsNmea:
- When the `trace' string provided to location_gps_nmea_take_trace() isn't
added to the hash table, its ownership is still considered transferred.
It should thus be freed. Similarly, the `trace_type' string isn't
added the hash table and should thus be freed.
- mm_location_gps_nmea_add_trace() duplicates a given trace string and
then passes the trace copy to location_gps_nmea_take_trace(). When
location_gps_nmea_take_trace() returns FALSE, the ownership of the
copy isn't transferred. mm_location_gps_nmea_add_trace() should thus
free the copy.
This patch fixes the above memory leaks by having
location_gps_nmea_take_trace() always take the ownership of the `trace'
string and internally free `trace' and `trace_type' when necessary.
Diffstat (limited to 'src/mm-sim-qmi.c')
0 files changed, 0 insertions, 0 deletions