Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/bluez:fix-obexd-5.48 into ~snappy-hwe-team/snappy-hwe-snaps/+git/bluez:bluez/5.48

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: 2453f2cfe4ca51ae0d64d37052f0dd81b944f2f7
Merged at revision: 963e1fc1d59191804bf4e50eeaae753bba3a9f55
Proposed branch: ~alfonsosanchezbeato/snappy-hwe-snaps/+git/bluez:fix-obexd-5.48
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/bluez:bluez/5.48
Diff against target: 15 lines (+3/-1)
1 file modified
obexd/src/main.c (+3/-1)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Review via email: mp+395147@code.launchpad.net

Commit message

obexd: don't free environment variable

Use g_strdup for option_root since it is expected to be freeable. When
this was assigned to an environement variable it would then be passed to
g_free and cause a crash because it wasn't memory that had been
malloced.

Description of the change

obexd: don't free environment variable

Use g_strdup for option_root since it is expected to be freeable. When
this was assigned to an environement variable it would then be passed to
g_free and cause a crash because it wasn't memory that had been
malloced.

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/obexd/src/main.c b/obexd/src/main.c
2index 118b5a1..ddea9fb 100644
3--- a/obexd/src/main.c
4+++ b/obexd/src/main.c
5@@ -285,7 +285,9 @@ int main(int argc, char *argv[])
6 }
7
8 if (option_root == NULL) {
9- option_root = getenv("SNAP_USER_DATA");
10+ const char * root_env = getenv("SNAP_USER_DATA");
11+ if (root_env)
12+ option_root = g_strdup(root_env);
13
14 if (!option_root)
15 option_root = g_build_filename(g_get_user_cache_dir(),

Subscribers

People subscribed via source and target branches