summaryrefslogtreecommitdiff
path: root/src/freebsd/up-device-supply.c
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-05-24 19:32:29 +0200
committerBenjamin Berg <bberg@redhat.com>2022-05-25 15:32:29 +0200
commit190d12e2929ea40327c6dcae073ed582dcea9f66 (patch)
tree229723db19776710a9e837dfe7fb01fbe71b7d29 /src/freebsd/up-device-supply.c
parent66eb9b9d7a56b5956e4b9df1bbd391226fd1bccf (diff)
downloadupower-190d12e2929ea40327c6dcae073ed582dcea9f66.tar.gz
common: Add a file with common helper
This removes some code duplication between the linux and freebsd backend. And, this file could become home to other small helper functions in the future.
Diffstat (limited to 'src/freebsd/up-device-supply.c')
-rw-r--r--src/freebsd/up-device-supply.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/freebsd/up-device-supply.c b/src/freebsd/up-device-supply.c
index 08bf2fc..f3770d1 100644
--- a/src/freebsd/up-device-supply.c
+++ b/src/freebsd/up-device-supply.c
@@ -204,9 +204,9 @@ up_device_supply_battery_set_properties (UpDevice *device, UpAcpiNative *native)
goto end;
}
- vendor = up_make_safe_string (battif.bif.oeminfo);
- model = up_make_safe_string (battif.bif.model);
- serial = up_make_safe_string (battif.bif.serial);
+ vendor = up_make_safe_string (g_strdup (battif.bif.oeminfo));
+ model = up_make_safe_string (g_strdup (battif.bif.model));
+ serial = up_make_safe_string (g_strdup (battif.bif.serial));
technology = up_device_supply_convert_device_technology (battif.bif.type);
g_object_set (device,