Merge ~morphis/snappy-hwe-snaps/+git/network-manager:network-manager/fix-settings-memory-leak into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:network-manager/1.2.2

Proposed by Simon Fels
Status: Merged
Approved by: Simon Fels
Approved revision: f25370d040bfa34ebb1547a369e42c5ee20a556c
Merged at revision: 534801d454988a29c4bc9f13024245c1b0753db5
Proposed branch: ~morphis/snappy-hwe-snaps/+git/network-manager:network-manager/fix-settings-memory-leak
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:network-manager/1.2.2
Diff against target: 22 lines (+2/-2)
1 file modified
src/settings/nm-settings-connection.c (+2/-2)
Reviewer Review Type Date Requested Status
Tony Espy Approve
Review via email: mp+303268@code.launchpad.net

Description of the change

Fix memory leak which will cause huge memory consumption over time

Changes:

 * [SNAPPY] Use static to make sure memory is only allocated once

To post a comment you must log in.
Revision history for this message
Simon Fels (morphis) wrote :
Revision history for this message
Tony Espy (awe) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c
index 3830769..d2504f9 100644
--- a/src/settings/nm-settings-connection.c
+++ b/src/settings/nm-settings-connection.c
@@ -38,7 +38,7 @@
3838
39static const char *get_settings_timestamps_path()39static const char *get_settings_timestamps_path()
40{40{
41 const char *timestamps_path = NULL;41 static const char *timestamps_path = NULL;
4242
43 if (!timestamps_path)43 if (!timestamps_path)
44 timestamps_path = g_strdup_printf("%s/timestamps", nm_utils_get_state_dir());44 timestamps_path = g_strdup_printf("%s/timestamps", nm_utils_get_state_dir());
@@ -48,7 +48,7 @@ static const char *get_settings_timestamps_path()
4848
49static const char *get_settings_seen_bssids_path()49static const char *get_settings_seen_bssids_path()
50{50{
51 const char *seen_bssids_path = NULL;51 static const char *seen_bssids_path = NULL;
5252
53 if (!seen_bssids_path)53 if (!seen_bssids_path)
54 seen_bssids_path = g_strdup_printf("%s/seen-bssids", nm_utils_get_state_dir());54 seen_bssids_path = g_strdup_printf("%s/seen-bssids", nm_utils_get_state_dir());

Subscribers

People subscribed via source and target branches