Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:fix-leaks-1.2.2 into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:network-manager/xenial/1.2.2

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: 10d8373cbc5ada5d94446b7e51e2894377ef5874
Merged at revision: ee7b759a6a106fe6ad91862c5cf4a1c3cca0b7f9
Proposed branch: ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:fix-leaks-1.2.2
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:network-manager/xenial/1.2.2
Diff against target: 47 lines (+4/-3)
3 files modified
src/nm-config.c (+1/-1)
src/nm-core-utils.c (+1/-0)
src/settings/nm-settings-connection.c (+2/-2)
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato continuous-integration Approve
System Enablement Bot continuous-integration Needs Fixing
Review via email: mp+394125@code.launchpad.net

Commit message

Fix memory leaks introduced in snap patches

Fix memory leaks that were introducing while adapting NM to use paths
inside the snap (LP#1902271).

Description of the change

Fix memory leaks introduced in snap patches

Fix memory leaks that were introducing while adapting NM to use paths
inside the snap (LP#1902271).

To post a comment you must log in.
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/nm-config.c b/src/nm-config.c
2index dac47c5..7753e9d 100644
3--- a/src/nm-config.c
4+++ b/src/nm-config.c
5@@ -42,7 +42,7 @@
6
7 static const char *get_no_auto_default_file_path()
8 {
9- const char *no_auto_default_file = NULL;
10+ static const char *no_auto_default_file = NULL;
11
12 if (!no_auto_default_file)
13 no_auto_default_file = g_strdup_printf("%s/no-auto-default.state", nm_utils_get_state_dir());
14diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
15index 9701e48..517dad0 100644
16--- a/src/nm-core-utils.c
17+++ b/src/nm-core-utils.c
18@@ -2691,6 +2691,7 @@ nm_utils_secret_key_read (gsize *out_key_len, GError **error)
19 }
20
21 out:
22+ g_free (secret_key_path);
23 if (key_len) {
24 *out_key_len = key_len;
25 return secret_key;
26diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c
27index 3830769..d2504f9 100644
28--- a/src/settings/nm-settings-connection.c
29+++ b/src/settings/nm-settings-connection.c
30@@ -38,7 +38,7 @@
31
32 static const char *get_settings_timestamps_path()
33 {
34- const char *timestamps_path = NULL;
35+ static const char *timestamps_path = NULL;
36
37 if (!timestamps_path)
38 timestamps_path = g_strdup_printf("%s/timestamps", nm_utils_get_state_dir());
39@@ -48,7 +48,7 @@ static const char *get_settings_timestamps_path()
40
41 static const char *get_settings_seen_bssids_path()
42 {
43- const char *seen_bssids_path = NULL;
44+ static const char *seen_bssids_path = NULL;
45
46 if (!seen_bssids_path)
47 seen_bssids_path = g_strdup_printf("%s/seen-bssids", nm_utils_get_state_dir());

Subscribers

People subscribed via source and target branches